Package org.scijava.module
Class ModuleRunner
- java.lang.Object
-
- org.scijava.AbstractContextual
-
- org.scijava.module.ModuleRunner
-
- All Implemented Interfaces:
Runnable,Callable<Module>,Contextual
public class ModuleRunner extends AbstractContextual implements Callable<Module>, Runnable
Helper class for executing aModule, including pre- and post-processing and event notification.This class implements both
RunnableandCallable, to make it easier to invoke in a variety of ways, such as with thejava.util.concurrentpackage.- Author:
- Curtis Rueden
-
-
Constructor Summary
Constructors Constructor Description ModuleRunner(Context context, Module module, List<? extends ModulePreprocessor> pre, List<? extends ModulePostprocessor> post)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Modulecall()voidpostProcess()Feeds the module through theModulePostprocessors.ModulePreprocessorpreProcess()Feeds the module through theModulePreprocessors.voidrun()Executes the module, including pre- and post-processing and event notification.-
Methods inherited from class org.scijava.AbstractContextual
context, getContext
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.scijava.Contextual
setContext
-
-
-
-
Constructor Detail
-
ModuleRunner
public ModuleRunner(Context context, Module module, List<? extends ModulePreprocessor> pre, List<? extends ModulePostprocessor> post)
-
-
Method Detail
-
preProcess
public ModulePreprocessor preProcess()
Feeds the module through theModulePreprocessors.- Returns:
- The preprocessor that canceled the execution, or null if all preprocessors completed successfully.
-
postProcess
public void postProcess()
Feeds the module through theModulePostprocessors.
-
-