Package org.apache.uima.flow.impl
Class FixedFlowController
- java.lang.Object
-
- org.apache.uima.flow.FlowController_ImplBase
-
- org.apache.uima.flow.CasFlowController_ImplBase
-
- org.apache.uima.flow.impl.FixedFlowController
-
- All Implemented Interfaces:
FlowController
public class FixedFlowController extends CasFlowController_ImplBase
Simple FlowController that invokes components in a fixed sequence.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringPARAM_ACTION_AFTER_CAS_MULTIPLIERKey for the configuration parameter that determines what should happen to a CAS after it has been input to a CAS Multiplier.
-
Constructor Summary
Constructors Constructor Description FixedFlowController()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAnalysisEngines(java.util.Collection<java.lang.String> aKeys)Does nothing by default.FlowcomputeFlow(CAS aCAS)This method must be overriden by subclasses.static FlowControllerDescriptiongetDescription()voidinitialize(FlowControllerContext aContext)Performs any startup tasks required by this component.voidremoveAnalysisEngines(java.util.Collection<java.lang.String> aKeys)Throws an AnalysisEngineProcessException by default.-
Methods inherited from class org.apache.uima.flow.CasFlowController_ImplBase
computeFlow, getRequiredCasInterface, typeSystemInit
-
Methods inherited from class org.apache.uima.flow.FlowController_ImplBase
batchProcessComplete, collectionProcessComplete, destroy, getContext, reconfigure
-
-
-
-
Field Detail
-
PARAM_ACTION_AFTER_CAS_MULTIPLIER
public static final java.lang.String PARAM_ACTION_AFTER_CAS_MULTIPLIER
Key for the configuration parameter that determines what should happen to a CAS after it has been input to a CAS Multiplier. Possible values are: continue: the CAS continues on to the next element in the flow stop: the CAS will no longer continue in the flow, and will be returned from the aggregate if possible. drop: the CAS will no longer continue in the flow, and will be dropped (not returned from the aggregate) if possible. dropIfNewCasProduced (the default): if the CAS multiplier produced a new CAS as a result of processing this CAS, then this CAS will be dropped. If not, then this CAS will continue.- See Also:
- Constant Field Values
-
-
Method Detail
-
initialize
public void initialize(FlowControllerContext aContext) throws ResourceInitializationException
Description copied from interface:FlowControllerPerforms any startup tasks required by this component. The framework calls this method only once, just after the FlowController has been instantiated.The framework supplies this FlowController with a reference to the
FlowControllerContextthat it will use, for example to access configuration settings or resources. This FlowController should store a reference to this Context for later use.- Specified by:
initializein interfaceFlowController- Overrides:
initializein classFlowController_ImplBase- Parameters:
aContext- Provides access to services and resources managed by the framework. This includes configuration parameters, logging, and access to external resources. Also provides the FlowController with the metadata of all of the AnalysisEngines that are possible targets for routing CASes.- Throws:
ResourceInitializationException- if the FlowController cannot initialize successfully.
-
computeFlow
public Flow computeFlow(CAS aCAS) throws AnalysisEngineProcessException
Description copied from class:CasFlowController_ImplBaseThis method must be overriden by subclasses. It takes aCASand returns aFlowobject that is responsible for routing this particular CAS through the components of this Aggregate. TheFlowobject should be given a handle to the CAS, so that it can use information in the CAS to make routing decisions.FlowController implementations will typically define their own class that implements
Flowby extending from the base classCasFlow_ImplBase. This method would then just instantiate the flow object, call itssetCasmethod to provide a handle to the CAS, and return the flow object.- Specified by:
computeFlowin classCasFlowController_ImplBase- Parameters:
aCAS- the CAS to be routed- Returns:
- a Flow object that will be used to route
aCAS - Throws:
AnalysisEngineProcessException- if a problem occurs during processing- See Also:
FlowController.computeFlow(AbstractCas)
-
addAnalysisEngines
public void addAnalysisEngines(java.util.Collection<java.lang.String> aKeys)
Description copied from class:FlowController_ImplBaseDoes nothing by default. Subclasses may override this to support adding new AnalysisEngines to the flow.- Specified by:
addAnalysisEnginesin interfaceFlowController- Overrides:
addAnalysisEnginesin classFlowController_ImplBase- Parameters:
aKeys- a Collection of Strings, each of which is the key of an Analysis Engine to which CASes can be routed. These are the same keys as used inFlowControllerContext.getAnalysisEngineMetaDataMap().- See Also:
FlowController.addAnalysisEngines(java.util.Collection)
-
removeAnalysisEngines
public void removeAnalysisEngines(java.util.Collection<java.lang.String> aKeys) throws AnalysisEngineProcessExceptionDescription copied from class:FlowController_ImplBaseThrows an AnalysisEngineProcessException by default. Subclasses may override this to support removing AnalysisEngines from the flow.- Specified by:
removeAnalysisEnginesin interfaceFlowController- Overrides:
removeAnalysisEnginesin classFlowController_ImplBase- Parameters:
aKeys- a Collection of Strings, each of which is the key of an Analysis Engine to which CASes may no longer be routed.- Throws:
AnalysisEngineProcessException- if the FlowController cannot continue with these Analysis Engines removed, or doesn't support removing Analysis Engines at all.- See Also:
FlowController.removeAnalysisEngines(java.util.Collection)
-
getDescription
public static FlowControllerDescription getDescription()
-
-