|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Flow
A Flow object is responsible for routing a single CAS through an Aggregate Analysis Engine.
Typically, developers extend CasFlow_ImplBase
or
JCasFlow_ImplBase
depending on which CAS interface they wish to use.
Method Summary | |
---|---|
void |
aborted()
Called by the framework if processing has been aborted for the CAS that was being routed by this Flow object. |
boolean |
continueOnFailure(String failedAeKey,
Exception failure)
May be called by the framework to ask the FlowController if processing of the CAS can continue after a failure occurred while executing the last Step that the Flow Controller returned. |
Flow |
newCasProduced(AbstractCas newCas,
String producedBy)
Called by the framework if the CAS that is being routed by this Flow has been sent to a CAS Multiplier which has then created a new CAS derived from that original CAS. |
Step |
next()
Gets the next destination for the CAS. |
Method Detail |
---|
Step next() throws AnalysisEngineProcessException
Step
object. There may be
different kinds of Step objects to indicate different kinds of routing actions.
AnalysisEngineProcessException
- if a failure occurs while determining the next destinationFlow newCasProduced(AbstractCas newCas, String producedBy) throws AnalysisEngineProcessException
It is not required for a Flow implementation to support the production of new CASes in the middle of the flow, in which case this method may throw an exception.
If implemented, this method should construct a new Flow
object that will be used to
route the new CAS. The new Flow object then takes over all responsibility for that CAS.
newCas
- the new CASproducedBy
- key of the AnalysisEngine (CAS Multiplier) that produced the new CAS
aCAS
through the
Aggregate Analysis Engine.
AnalysisEngineProcessException
boolean continueOnFailure(String failedAeKey, Exception failure)
If this method returns true, then the framework may continue to call the next()
method
to continue routing the CAS. If this method returns false, the framework will not make any
more calls to the next()
method, and will call the aborted()
method.
In the case where the last Step was a ParallelStep
, if at least one of the destinations
resulted in a failure, this method will be called to report one of the failures. If this method
returns true, but one of the other destinations in the ParallelStep resulted in a failure, this
method will be called again to report the next failure. This continues until either this method
returns false or there are no more failures.
Note that it is possible for processing of a CAS to be aborted without this method being called. This method is only called when an attempt is being made to continue processing of the CAS following an error, which may be an application configuration decision.
failedAeKey
- The key of the analysis engine that failed.failure
- the Exception that occurred
void aborted()
next()
method again.
This method provides the Flow object with an opportunity to clean up any resources. Also, it could be used to allow the FlowController to reuse a Flow object if desired.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |