Package org.mapfish.print.processor
Class AbstractProcessor.Context
java.lang.Object
org.mapfish.print.processor.AbstractProcessor.Context
- All Implemented Interfaces:
Processor.ExecutionContext
- Enclosing class:
- AbstractProcessor<IN,
OUT>
public static final class AbstractProcessor.Context
extends Object
implements Processor.ExecutionContext
Default implementation of
Processor.ExecutionContext
.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
cancel()
Sets the canceled flag.getStats()
<T> T
mdcContext
(Supplier<T> action) Set the MDC context while running the action.<T> T
mdcContextEx
(Callable<T> action) Set the MDC context while running the action.void
Throws a CancellationException if the job was canceled.
-
Constructor Details
-
Context
- Parameters:
mdcContext
- The MDC context.
-
-
Method Details
-
cancel
public void cancel()Sets the canceled flag. -
stopIfCanceled
public void stopIfCanceled()Description copied from interface:Processor.ExecutionContext
Throws a CancellationException if the job was canceled.- Specified by:
stopIfCanceled
in interfaceProcessor.ExecutionContext
-
getStats
- Specified by:
getStats
in interfaceProcessor.ExecutionContext
- Returns:
- The ExecutionStats object
-
getMDCContext
- Specified by:
getMDCContext
in interfaceProcessor.ExecutionContext
- Returns:
- The MDC context for the current print job.
-
mdcContext
Description copied from interface:Processor.ExecutionContext
Set the MDC context while running the action.- Specified by:
mdcContext
in interfaceProcessor.ExecutionContext
- Type Parameters:
T
- The returned class- Parameters:
action
- The action to run
-
mdcContextEx
Description copied from interface:Processor.ExecutionContext
Set the MDC context while running the action.- Specified by:
mdcContextEx
in interfaceProcessor.ExecutionContext
- Type Parameters:
T
- The returned class- Parameters:
action
- The action to run- Throws:
Exception
-