Package org.apache.uima.flow.impl
Class CapabilityLanguageFlowController
java.lang.Object
org.apache.uima.flow.FlowController_ImplBase
org.apache.uima.flow.CasFlowController_ImplBase
org.apache.uima.flow.impl.CapabilityLanguageFlowController
- All Implemented Interfaces:
FlowController
FlowController for the CapabilityLanguageFlow, which uses a linear flow but may skip some of the
AEs in the flow if they do not handle the language of the current document or if their outputs
have already been produced by a previous AE in the flow.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncomputeFlow
(CAS aCAS) This method must be overriden by subclasses.protected Map<String,
List<AnalysisSequenceCapabilityNode>> computeFlowTable
(Capability[] aCapabilities) method computeFlowTable create the flow table for faster processing.protected List<AnalysisSequenceCapabilityNode>
computeSequence
(String language, Capability[] aCapabilities) method computeSequence creates a capabilityLanguageAnalysisSequence for the given languagestatic FlowControllerDescription
void
initialize
(FlowControllerContext aContext) Performs any startup tasks required by this component.Methods inherited from class org.apache.uima.flow.CasFlowController_ImplBase
computeFlow, getRequiredCasInterface, typeSystemInit
Methods inherited from class org.apache.uima.flow.FlowController_ImplBase
addAnalysisEngines, batchProcessComplete, collectionProcessComplete, destroy, getContext, getLogger, reconfigure, removeAnalysisEngines
-
Constructor Details
-
CapabilityLanguageFlowController
public CapabilityLanguageFlowController()
-
-
Method Details
-
initialize
Description copied from interface:FlowController
Performs 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
FlowControllerContext
that 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:
initialize
in interfaceFlowController
- Overrides:
initialize
in 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
Description copied from class:CasFlowController_ImplBase
This method must be overriden by subclasses. It takes aCAS
and returns aFlow
object that is responsible for routing this particular CAS through the components of this Aggregate. TheFlow
object 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
Flow
by extending from the base classCasFlow_ImplBase
. This method would then just instantiate the flow object, call itssetCas
method to provide a handle to the CAS, and return the flow object.- Specified by:
computeFlow
in 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:
-
computeFlowTable
protected Map<String,List<AnalysisSequenceCapabilityNode>> computeFlowTable(Capability[] aCapabilities) method computeFlowTable create the flow table for faster processing. The flow table includes the corresponding flow sequence for all languages in the capabilities- Parameters:
aCapabilities
- aggregate engine capabilities- Returns:
- Map - flow table includes all sequences for all languages
-
computeSequence
protected List<AnalysisSequenceCapabilityNode> computeSequence(String language, Capability[] aCapabilities) method computeSequence creates a capabilityLanguageAnalysisSequence for the given language- Parameters:
language
- current languageaCapabilities
- output capabilities of the aggregate engine- Returns:
- List - capabilityLanguageAnalysisSequence for the current language
-
getDescription
-
getLastResultSpecForComponent
-