Class AggregateAnalysisEngine_impl
- java.lang.Object
-
- org.apache.uima.resource.Resource_ImplBase
-
- org.apache.uima.resource.ConfigurableResource_ImplBase
-
- org.apache.uima.analysis_engine.impl.AnalysisEngineImplBase
-
- org.apache.uima.analysis_engine.impl.AggregateAnalysisEngine_impl
-
- All Implemented Interfaces:
AnalysisEngine,TextAnalysisEngine,CasObjectProcessor,CasProcessor,ConfigurableResource,Resource
public class AggregateAnalysisEngine_impl extends AnalysisEngineImplBase implements AnalysisEngine
Reference implementation ofAnalysisEngine.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringPARAM_RESULT_SPECIFICATION-
Fields inherited from class org.apache.uima.analysis_engine.impl.AnalysisEngineImplBase
LOG_RESOURCE_BUNDLE, PARAM_VERIFICATION_MODE
-
Fields inherited from interface org.apache.uima.analysis_engine.AnalysisEngine
PARAM_CONFIG_PARAM_SETTINGS, PARAM_MBEAN_NAME_PREFIX, PARAM_MBEAN_SERVER, PARAM_NUM_SIMULTANEOUS_REQUESTS, PARAM_RESOURCE_MANAGER, PARAM_TIMEOUT_PERIOD
-
Fields inherited from interface org.apache.uima.resource.Resource
PARAM_AGGREGATE_SOFA_MAPPINGS, PARAM_CONFIG_MANAGER, PARAM_CONFIG_PARAM_SETTINGS, PARAM_EXTERNAL_OVERRIDE_SETTINGS, PARAM_PERFORMANCE_TUNING_SETTINGS, PARAM_RESOURCE_MANAGER, PARAM_UIMA_CONTEXT
-
-
Constructor Summary
Constructors Constructor Description AggregateAnalysisEngine_impl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ASB_getASB()For an aggregate AnalysisEngine only, gets the ASB component.protected java.util.Map<java.lang.String,ResourceSpecifier>_getComponentCasProcessorSpecifierMap()For an aggregate AnalysisEngine only, gets a Map from each component's key to the specifier for that component.protected java.util.Map<java.lang.String,ProcessingResourceMetaData>_getComponentMetaData()For an aggregate AnalysisEngine only, gets a Map from each component's key to ProcessingResourceMetaData for that component.voidbatchProcessComplete()Notifies this AnalysisEngine that processing of a batch has completed.protected voidbuildProcessTraceFromMBeanStats(ProcessTrace trace)Construct a ProcessTrace object that represents the last execution of this AnalysisEngine.voidcollectionProcessComplete()Notifies this AnalysisEngine that processing of an entire collection has completed.voiddestroy()Releases all resources held by thisResource.protected FlowControllerDeclarationgetDefaultFlowControllerDeclaration()protected voidinitASB(AnalysisEngineDescription aAnalysisEngineDescription, java.util.Map<java.lang.String,java.lang.Object> aAdditionalParams)A utility method that creates and configures the ASB component.booleaninitialize(ResourceSpecifier aSpecifier, java.util.Map<java.lang.String,java.lang.Object> aAdditionalParams)Initializes thisResourcefrom aResourceSpecifier.protected voidinitializeAggregateAnalysisEngine(AnalysisEngineDescription aDescription, java.util.Map<java.lang.String,java.lang.Object> aAdditionalParams)A utility method that performs initialization logic for a aggregate AnalysisEngine.CasIteratorprocessAndOutputNewCASes(CAS aCAS)Processes a CAS, possibly producing multiple CASes as a result.protected voidprocessDelegateAnalysisEngineMetaData()Does processing using the delegate AnalysisEngine metadata once it becomes available.voidreconfigure()Instructs this Resource to re-read its configuration parameter settings.voidsetResultSpecification(ResultSpecification aResultSpec)Sets the list of output types and features that the application wants this AnalysisEngine to produce.protected voidvalidateOperationalProperties()Checks operational properties in an aggregate to ensure they are not inconsistent with operational properties of the components.-
Methods inherited from class org.apache.uima.analysis_engine.impl.AnalysisEngineImplBase
batchProcessComplete, buildProcessTraceFromMBeanStats, collectionProcessComplete, createResultSpecification, createResultSpecification, enterBatchProcessComplete, enterCollectionProcessComplete, enterProcess, exitBatchProcessComplete, exitCollectionProcessComplete, exitProcess, finalize, getAnalysisEngineMetaData, getCurrentConfigParameterSettings, getFeatureNamesForType, getManagementInterface, getMBean, getMBeanNamePrefix, getMBeanServer, getPerformanceTuningSettings, getProcessingResourceMetaData, isProcessTraceEnabled, isReadOnly, isStateless, newCAS, newJCas, normalizeIsoLangCodes, process, process, process, process, process, process, process, processAndOutputNewCASes, processCas, processCas, resetResultSpecificationToDefault, setMetaData, setPerformanceTuningSettings, typeSystemInit
-
Methods inherited from class org.apache.uima.resource.ConfigurableResource_ImplBase
getConfigParameterValue, getConfigParameterValue, setConfigParameterValue, setConfigParameterValue
-
Methods inherited from class org.apache.uima.resource.Resource_ImplBase
getCasManager, getLogger, getMetaData, getRelativePathResolver, getResourceManager, getUimaContext, getUimaContextAdmin, setLogger
-
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.uima.analysis_engine.AnalysisEngine
createResultSpecification, createResultSpecification, getAnalysisEngineMetaData, getFeatureNamesForType, getLogger, getManagementInterface, getPerformanceTuningSettings, getResourceManager, newCAS, newJCas, process, process, process, process, process, process, process, processAndOutputNewCASes, setLogger
-
Methods inherited from interface org.apache.uima.collection.base_cpm.CasObjectProcessor
processCas, processCas, typeSystemInit
-
Methods inherited from interface org.apache.uima.collection.base_cpm.CasProcessor
batchProcessComplete, collectionProcessComplete, getProcessingResourceMetaData, isReadOnly, isStateless
-
Methods inherited from interface org.apache.uima.resource.ConfigurableResource
getConfigParameterValue, getConfigParameterValue, setConfigParameterValue, setConfigParameterValue
-
Methods inherited from interface org.apache.uima.resource.Resource
getMetaData, getUimaContext, getUimaContextAdmin
-
-
-
-
Field Detail
-
PARAM_RESULT_SPECIFICATION
public static final java.lang.String PARAM_RESULT_SPECIFICATION
- See Also:
- Constant Field Values
-
-
Method Detail
-
initialize
public boolean initialize(ResourceSpecifier aSpecifier, java.util.Map<java.lang.String,java.lang.Object> aAdditionalParams) throws ResourceInitializationException
Description copied from interface:ResourceInitializes thisResourcefrom aResourceSpecifier. Applications do not need to call this method. It is called automatically by theResourceFactoryand cannot be called a second time.- Specified by:
initializein interfaceAnalysisEngine- Specified by:
initializein interfaceResource- Overrides:
initializein classAnalysisEngineImplBase- Parameters:
aSpecifier- specifies how to create a resource or locate an existing resource service.aAdditionalParams- a Map containing additional parameters. May benullif there are no parameters. Each class that implements this interface can decide what additional parameters it supports.- Returns:
- true if and only if initialization completed successfully. Reutrns false if the given
ResourceSpecifieris not of an appropriate type for this Resource. If theResourceSpecifieris of an appropriate type but is invalid or if some other failure occurs, an exception should be thrown. - Throws:
ResourceInitializationException- if a failure occurs during initialization.- See Also:
Resource.initialize(ResourceSpecifier, Map)
-
setResultSpecification
public void setResultSpecification(ResultSpecification aResultSpec)
Description copied from interface:AnalysisEngineSets the list of output types and features that the application wants this AnalysisEngine to produce. This is only a guideline. Annotators may use this information to avoid doing unnecessary work, but they are not required to do so.- Specified by:
setResultSpecificationin interfaceAnalysisEngine- Overrides:
setResultSpecificationin classAnalysisEngineImplBase- Parameters:
aResultSpec- specifies the list of output types and features that the application is interested in.
-
destroy
public void destroy()
Description copied from interface:ResourceReleases all resources held by thisResource.- Specified by:
destroyin interfaceResource- Overrides:
destroyin classResource_ImplBase- See Also:
Resource.destroy()
-
processAndOutputNewCASes
public CasIterator processAndOutputNewCASes(CAS aCAS) throws AnalysisEngineProcessException
Description copied from interface:AnalysisEngineProcesses a CAS, possibly producing multiple CASes as a result. The application uses theCasIteratorinterface to step through the output CASes.If this Analysis Engine does not produce output CASes, then the
CasIteratorwill return no elements. You can check if an AnalysisEngine is capable of producing output CASes by checking theOperationalProperties.getOutputsNewCASes()operational property (getAnalysisEngineMetaData().getOperationalProperties().getOutputsNewCASes()).Once this method is called, the AnalysisEngine "owns"
aCASuntil such time as theCasIterator.hasNext()method returns false. That is, the caller should not attempt to modify or access the input CAS until it has read all of the elements from the CasIterator. If the caller wants to abort the processing before having read all of the output CASes, it may callCasIterator.release(), which will stop further processing from occurring, and ownership ofaCASwill revert to the caller.- Specified by:
processAndOutputNewCASesin interfaceAnalysisEngine- Overrides:
processAndOutputNewCASesin classAnalysisEngineImplBase- Parameters:
aCAS- the CAS to be processed- Returns:
- an object for iterating through any output CASes
- Throws:
AnalysisEngineProcessException- if a failure occurs during processing- See Also:
AnalysisEngine.processAndOutputNewCASes(CAS)
-
reconfigure
public void reconfigure() throws ResourceConfigurationExceptionDescription copied from interface:ConfigurableResourceInstructs this Resource to re-read its configuration parameter settings.- Specified by:
reconfigurein interfaceAnalysisEngine- Specified by:
reconfigurein interfaceConfigurableResource- Overrides:
reconfigurein classConfigurableResource_ImplBase- Throws:
ResourceConfigurationException- if the configuration is not valid- See Also:
AnalysisEngine.reconfigure()
-
batchProcessComplete
public void batchProcessComplete() throws AnalysisEngineProcessExceptionDescription copied from interface:AnalysisEngineNotifies this AnalysisEngine that processing of a batch has completed. It is up to the caller to determine the size of a batch. Components (particularly CAS Consumers) inside this Analysis Engine may respond to this event, for example by writing data to the disk.- Specified by:
batchProcessCompletein interfaceAnalysisEngine- Overrides:
batchProcessCompletein classAnalysisEngineImplBase- Throws:
AnalysisEngineProcessException- if an exception occurs during processing
-
collectionProcessComplete
public void collectionProcessComplete() throws AnalysisEngineProcessExceptionDescription copied from interface:AnalysisEngineNotifies this AnalysisEngine that processing of an entire collection has completed. It is up to the caller to determine when this has occurred. Components (particularly CAS Consumers) inside this Analysis Engine may respond to this event, for example by writing data to the disk.If this AnalysisEngine is an aggregate, this method will call the collectionProcessComplete method of all components of that aggregate. If the aggregate descriptor declares a
fixedFloworcapabilityLanguageFlow, then the components' collectionProcessComplete methods will be called in the order specified by that flow element. Once all components in the flow have been called, any components not declared in the flow will be called, in arbitrary order. If there is nofixedFloworcapabilityLanguageFlow, then all components in the aggregate will be called in arbitrary order.- Specified by:
collectionProcessCompletein interfaceAnalysisEngine- Overrides:
collectionProcessCompletein classAnalysisEngineImplBase- Throws:
AnalysisEngineProcessException- if an exception occurs during processing
-
initializeAggregateAnalysisEngine
protected void initializeAggregateAnalysisEngine(AnalysisEngineDescription aDescription, java.util.Map<java.lang.String,java.lang.Object> aAdditionalParams) throws ResourceInitializationException
A utility method that performs initialization logic for a aggregate AnalysisEngine.- Parameters:
aDescription- the AnalysisEngine description for this AnalysisEngineaAdditionalParams- additional parameters that were passed to this AnalysisEngine's initialize method.- Throws:
ResourceInitializationException- if an initialization failure occurs
-
initASB
protected void initASB(AnalysisEngineDescription aAnalysisEngineDescription, java.util.Map<java.lang.String,java.lang.Object> aAdditionalParams) throws ResourceInitializationException
A utility method that creates and configures the ASB component. The ASB will create and initialize the delegate AnalysisEngines. This method also retrieves delegate AnalysisEngine metadata from the ASB and provides access to that method via the_getComponentMetaData()method.- Parameters:
aAnalysisEngineDescription- the AnalysisEngine description for this AnalysisEngineaAdditionalParams- parameters that will be passed to the ASB's initialize method.- Throws:
ResourceInitializationException- if the ASB or a delegate AnalysisEngine could not be created.
-
processDelegateAnalysisEngineMetaData
protected void processDelegateAnalysisEngineMetaData() throws ResourceInitializationExceptionDoes processing using the delegate AnalysisEngine metadata once it becomes available.Specifically, sets this aggregate AE's Type System, Type Priorities, and FS Index Descriptions equal to the result of merging the information from its delegate AEs.
- Throws:
ResourceInitializationException- if an error occurs
-
validateOperationalProperties
protected void validateOperationalProperties() throws ResourceInitializationExceptionChecks operational properties in an aggregate to ensure they are not inconsistent with operational properties of the components. For example, an aggregate cannot have multipleDeploymentAlloiwed == true if it contains a component with multipleDeploymentAllowed == false.- Throws:
ResourceInitializationException- if there is an invalid parameter override declaration
-
getDefaultFlowControllerDeclaration
protected FlowControllerDeclaration getDefaultFlowControllerDeclaration()
- Returns:
- the default FlowController declaration to be used if the aggregate AE descriptor does not specify one.
-
_getASB
protected ASB _getASB()
For an aggregate AnalysisEngine only, gets the ASB component.- Returns:
- the ASB
-
_getComponentMetaData
protected java.util.Map<java.lang.String,ProcessingResourceMetaData> _getComponentMetaData()
For an aggregate AnalysisEngine only, gets a Map from each component's key to ProcessingResourceMetaData for that component. This includes component AEs as well as the FlowController.- Returns:
- a Map from String keys to ProcessingResourceMetaData objects.
-
_getComponentCasProcessorSpecifierMap
protected java.util.Map<java.lang.String,ResourceSpecifier> _getComponentCasProcessorSpecifierMap()
For an aggregate AnalysisEngine only, gets a Map from each component's key to the specifier for that component.- Returns:
- a Map with String keys and ResourceSpecifier values
-
buildProcessTraceFromMBeanStats
protected void buildProcessTraceFromMBeanStats(ProcessTrace trace)
Construct a ProcessTrace object that represents the last execution of this AnalysisEngine. This is used so that we can return a ProcessTrace object from each process() call for backwards compatibility with version 1.x.- Overrides:
buildProcessTraceFromMBeanStatsin classAnalysisEngineImplBase- Parameters:
trace- -
-
-