org.apache.uima.examples.flow
Class AdvancedFixedFlowController

java.lang.Object
  extended by org.apache.uima.flow.FlowController_ImplBase
      extended by org.apache.uima.flow.CasFlowController_ImplBase
          extended by org.apache.uima.examples.flow.AdvancedFixedFlowController
All Implemented Interfaces:
FlowController

public class AdvancedFixedFlowController
extends CasFlowController_ImplBase

Simple FlowController that invokes components in a fixed sequence.


Field Summary
static java.lang.String PARAM_ACTION_AFTER_CAS_MULTIPLIER
           
static java.lang.String PARAM_ALLOW_CONTINUE_ON_FAILURE
           
static java.lang.String PARAM_FLOW
           
 
Constructor Summary
AdvancedFixedFlowController()
           
 
Method Summary
 void addAnalysisEngines(java.util.Collection aKeys)
          Does nothing by default.
 Flow computeFlow(CAS aCAS)
          This method must be overriden by subclasses.
 void initialize(FlowControllerContext aContext)
          Performs any startup tasks required by this component.
 void removeAnalysisEngines(java.util.Collection 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PARAM_ACTION_AFTER_CAS_MULTIPLIER

public static final java.lang.String PARAM_ACTION_AFTER_CAS_MULTIPLIER
See Also:
Constant Field Values

PARAM_ALLOW_CONTINUE_ON_FAILURE

public static final java.lang.String PARAM_ALLOW_CONTINUE_ON_FAILURE
See Also:
Constant Field Values

PARAM_FLOW

public static final java.lang.String PARAM_FLOW
See Also:
Constant Field Values
Constructor Detail

AdvancedFixedFlowController

public AdvancedFixedFlowController()
Method Detail

initialize

public void initialize(FlowControllerContext aContext)
                throws ResourceInitializationException
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 interface FlowController
Overrides:
initialize in class FlowController_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_ImplBase
This method must be overriden by subclasses. It takes a CAS and returns a Flow object that is responsible for routing this particular CAS through the components of this Aggregate. The Flow 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 class CasFlow_ImplBase. This method would then just instantiate the flow object, call its setCas method to provide a handle to the CAS, and return the flow object.

Specified by:
computeFlow in class CasFlowController_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 aKeys)
Description copied from class: FlowController_ImplBase
Does nothing by default. Subclasses may override this to support adding new AnalysisEngines to the flow.

Specified by:
addAnalysisEngines in interface FlowController
Overrides:
addAnalysisEngines in class FlowController_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 in FlowControllerContext.getAnalysisEngineMetaDataMap().
See Also:
FlowController.addAnalysisEngines(java.util.Collection)

removeAnalysisEngines

public void removeAnalysisEngines(java.util.Collection aKeys)
                           throws AnalysisEngineProcessException
Description copied from class: FlowController_ImplBase
Throws an AnalysisEngineProcessException by default. Subclasses may override this to support removing AnalysisEngines from the flow.

Specified by:
removeAnalysisEngines in interface FlowController
Overrides:
removeAnalysisEngines in class FlowController_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)


Copyright © 2011. All Rights Reserved.