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 TypeMethodDescriptionvoidcancel()Sets the canceled flag.getStats()<T> TmdcContext(Supplier<T> action) Set the MDC context while running the action.<T> TmdcContextEx(Callable<T> action) Set the MDC context while running the action.voidThrows a CancellationException if the job was canceled.
-
Constructor Details
-
Context
- Parameters:
mdcContext- The MDC context.taskCanceled- whether the task should be canceled or not
-
-
Method Details
-
cancel
public void cancel()Sets the canceled flag. -
stopIfCanceled
public void stopIfCanceled()Description copied from interface:Processor.ExecutionContextThrows a CancellationException if the job was canceled.- Specified by:
stopIfCanceledin interfaceProcessor.ExecutionContext
-
getStats
- Specified by:
getStatsin interfaceProcessor.ExecutionContext- Returns:
- The ExecutionStats object
-
getMDCContext
- Specified by:
getMDCContextin interfaceProcessor.ExecutionContext- Returns:
- The MDC context for the current print job.
-
mdcContext
Description copied from interface:Processor.ExecutionContextSet the MDC context while running the action.- Specified by:
mdcContextin interfaceProcessor.ExecutionContext- Type Parameters:
T- The returned class- Parameters:
action- The action to run
-
mdcContextEx
Description copied from interface:Processor.ExecutionContextSet the MDC context while running the action.- Specified by:
mdcContextExin interfaceProcessor.ExecutionContext- Type Parameters:
T- The returned class- Parameters:
action- The action to run- Throws:
Exception
-