Package org.apache.uima.flow
Class CasFlow_ImplBase
java.lang.Object
org.apache.uima.flow.CasFlow_ImplBase
- All Implemented Interfaces:
Flow
- Direct Known Subclasses:
CapabilityLanguageFlowObject
Convenience base class for Flow objects that use the CAS interface. Stores the CAS in a field
made accessible through the protected
getCas()
method.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
aborted()
By default, does nothing.boolean
continueOnFailure
(String failedAeKey, Exception failure) By default, returns false, indicating that processing cannot continue after a failure.protected CAS
getCas()
Gets the CAS being routed by this Flow object.final Flow
newCasProduced
(AbstractCas newCas, String producedBy) Overridden to check thatnewCas
is an instanceofCAS
.protected Flow
newCasProduced
(CAS newCas, String producedBy) By default, throws an exception to indicate this this Flow object does not support new CASes being produced in the middle of the flow.void
Deprecated.this is automatically done by the framework after a new flow object is created
-
Constructor Details
-
CasFlow_ImplBase
public CasFlow_ImplBase()
-
-
Method Details
-
setCas
Deprecated.this is automatically done by the framework after a new flow object is createdSets the CAS to be routed by this Flow object. This should be called from theFlowController.computeFlow(AbstractCas)
method after this Flow object is instantiated.- Parameters:
aCAS
- the CAS to be routed by this Flow object- To be removed in version:
- 4.0.0
-
newCasProduced
public final Flow newCasProduced(AbstractCas newCas, String producedBy) throws AnalysisEngineProcessException Overridden to check thatnewCas
is an instanceofCAS
. If it is, thennewCasProduced(CAS,String)
is called. If not, an exception is thrown.- Specified by:
newCasProduced
in interfaceFlow
- Parameters:
newCas
- the new CASproducedBy
- key of the AnalysisEngine (CAS Multiplier) that produced the new CAS- Returns:
- a new Flow object that has responsibility for routing
aCAS
through the Aggregate Analysis Engine. - Throws:
AnalysisEngineProcessException
- passthru- See Also:
-
continueOnFailure
By default, returns false, indicating that processing cannot continue after a failure. May be overridden by subclasses to allow processing to continue.- Specified by:
continueOnFailure
in interfaceFlow
- Parameters:
failedAeKey
- The key of the analysis engine that failed.failure
- the Exception that occurred- Returns:
- true if the FlowController decides that processing of the CAS can continue; false if processing of the CAS should be aborted.
- See Also:
-
aborted
public void aborted()By default, does nothing. May be overriden by subclasses to release resources when a flow is aborted. -
newCasProduced
By default, throws an exception to indicate this this Flow object does not support new CASes being produced in the middle of the flow. Subclasses can override to implement handling for this.- Parameters:
newCas
- the new CASproducedBy
- the key of the CAS Multiplier that produced this CAS- Returns:
- a Flow object that will be used to route the new CAS
- Throws:
AnalysisEngineProcessException
- passthru- See Also:
-
getCas
Gets the CAS being routed by this Flow object.- Returns:
- the CAS being routed by this Flow object
-