Package org.apache.uima.flow
Class CasFlowController_ImplBase
- java.lang.Object
-
- org.apache.uima.flow.FlowController_ImplBase
-
- org.apache.uima.flow.CasFlowController_ImplBase
-
- All Implemented Interfaces:
FlowController
- Direct Known Subclasses:
CapabilityLanguageFlowController
,FixedFlowController
public abstract class CasFlowController_ImplBase extends FlowController_ImplBase
Base class to be extended by FlowControllers that use theCAS
interface.
-
-
Field Summary
Fields Modifier and Type Field Description private TypeSystem
mLastTypeSystem
-
Constructor Summary
Constructors Constructor Description CasFlowController_ImplBase()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description private void
checkTypeSystemChange(CAS aCAS)
Flow
computeFlow(AbstractCas aCAS)
Overriden to check thataCAS
is an instanceofCAS
.abstract Flow
computeFlow(CAS aCAS)
This method must be overriden by subclasses.java.lang.Class<CAS>
getRequiredCasInterface()
Returns the specific CAS interface that this FlowController requires the framework to pass to itsFlowController.computeFlow(AbstractCas)
method.void
typeSystemInit(TypeSystem aTypeSystem)
This method may be overriden by subclasses.-
Methods inherited from class org.apache.uima.flow.FlowController_ImplBase
addAnalysisEngines, batchProcessComplete, collectionProcessComplete, destroy, getContext, getLogger, initialize, reconfigure, removeAnalysisEngines
-
-
-
-
Field Detail
-
mLastTypeSystem
private TypeSystem mLastTypeSystem
-
-
Method Detail
-
getRequiredCasInterface
public java.lang.Class<CAS> getRequiredCasInterface()
Description copied from interface:FlowController
Returns the specific CAS interface that this FlowController requires the framework to pass to itsFlowController.computeFlow(AbstractCas)
method.- Returns:
- the required CAS interface. This must specify a subtype of
AbstractCas
.
-
computeFlow
public final Flow computeFlow(AbstractCas aCAS) throws AnalysisEngineProcessException
Overriden to check thataCAS
is an instanceofCAS
. If it is, thencomputeFlow(CAS)
is called. If not, an exception is thrown.- Parameters:
aCAS
- A CAS that this FlowController should process. The framework will ensure that aCAS implements the specific CAS interface declared in the <casInterface> element of this FlowController's descriptor.- Returns:
- a Flow object that has responsibility for routing
aCAS
through the Aggregate Analysis Engine. - Throws:
AnalysisEngineProcessException
- if this FlowController encounters a problem computing the flow for the CAS- See Also:
FlowController.computeFlow(AbstractCas)
-
computeFlow
public abstract Flow computeFlow(CAS aCAS) throws AnalysisEngineProcessException
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.- 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)
-
typeSystemInit
public void typeSystemInit(TypeSystem aTypeSystem) throws AnalysisEngineProcessException
This method may be overriden by subclasses. It is called whenever th TypeSystem of the CAS changes. This method will be called immediately prior to the first call tocomputeFlow(CAS)
, and will be called again whenever the CAS TypeSystem changes.In this method, the FlowController can use the
TypeSystem
to resolve the names of Type and Features to the actualType
andFeature
objects, which can then be used to access information from the CAS during routing.- Parameters:
aTypeSystem
- the typesystem- Throws:
AnalysisEngineProcessException
- if a problem occurs during processing
-
checkTypeSystemChange
private void checkTypeSystemChange(CAS aCAS) throws AnalysisEngineProcessException
- Throws:
AnalysisEngineProcessException
-
-