Class AnalysisEngineProcessorAdapter
- All Implemented Interfaces:
AnalysisEngine,TextAnalysisEngine,CasObjectProcessor,CasProcessor,CasConsumer,ConfigurableResource,Resource
- Direct Known Subclasses:
CasProcessorAnnotator,JCasProcessorAnnotator
-
Field Summary
Fields inherited from class org.apache.uima.analysis_engine.impl.AnalysisEngineImplBase
LOG_RESOURCE_BUNDLE, PARAM_VERIFICATION_MODEFields inherited from interface org.apache.uima.analysis_engine.AnalysisEngine
MDC_ANNOTATOR_CONTEXT_NAME, MDC_ANNOTATOR_IMPL_NAME, MDC_CAS_ID, MDC_ROOT_CONTEXT_ID, PARAM_CONFIG_PARAM_SETTINGS, PARAM_MBEAN_NAME_PREFIX, PARAM_MBEAN_SERVER, PARAM_NUM_SIMULTANEOUS_REQUESTS, PARAM_RESOURCE_MANAGER, PARAM_THROTTLE_EXCESSIVE_ANNOTATOR_LOGGING, PARAM_TIMEOUT_PERIODFields 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 -
Method Summary
Modifier and TypeMethodDescriptionvoidNotifies this AnalysisEngine that processing of a batch has completed.voidNotifies this AnalysisEngine that processing of an entire collection has completed.voiddestroy()Releases all resources held by thisResource.getConfigParameterValue(String aParamName) Looks up the value of a configuration parameter.getConfigParameterValue(String aGroupName, String aParamName) Looks up the value of a configuration parameter in a group.Gets the metadata that describes thisResource.protected StringGets the name of this resource, for use in logging and trace messages.protected AnalysisEngineProcessorStubgetStub()Gets the stub to be used to communicate with the remote service.processAndOutputNewCASes(CAS aCAS) Processes a CAS, possibly producing multiple CASes as a result.voidInstructs this Resource to re-read its configuration parameter settings.voidsetConfigParameterValue(String aParamName, Object aValue) Sets the value of a configuration parameter.voidsetConfigParameterValue(String aGroupName, String aParamName, Object aValue) Sets the value of a configuration parameter in a group.protected voidSets the stub to be used to actual implementation.Methods inherited from class org.apache.uima.analysis_engine.impl.AnalysisEngineImplBase
batchProcessComplete, buildProcessTraceFromMBeanStats, buildProcessTraceFromMBeanStats, callInitializeMethod, callProcessMethod, collectionProcessComplete, createResultSpecification, createResultSpecification, enterBatchProcessComplete, enterCollectionProcessComplete, enterProcess, exitBatchProcessComplete, exitCollectionProcessComplete, exitProcess, finalize, getAnalysisEngineMetaData, getCurrentConfigParameterSettings, getFeatureNamesForType, getManagementInterface, getMBean, getMBeanNamePrefix, getMBeanServer, getPerformanceTuningSettings, getProcessingResourceMetaData, initialize, isProcessTraceEnabled, isReadOnly, isStateless, newCAS, newJCas, normalizeIsoLangCodes, process, process, process, process, process, process, process, processAndOutputNewCASes, processCas, processCas, resetResultSpecificationToDefault, setMetaData, setPerformanceTuningSettings, setResultSpecification, typeSystemInitMethods inherited from class org.apache.uima.resource.Resource_ImplBase
getCasManager, getLogger, getRelativePathResolver, getResourceManager, getUimaContext, getUimaContextAdmin, loadUserClass, loadUserClassOrThrow, setContextHolder, setContextHolderX, setLogger, withContextHolderMethods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.uima.analysis_engine.AnalysisEngine
createResultSpecification, createResultSpecification, getAnalysisEngineMetaData, getFeatureNamesForType, getLogger, getManagementInterface, getPerformanceTuningSettings, getResourceManager, initialize, newCAS, newJCas, process, process, process, process, process, process, process, processAndOutputNewCASes, setLogger, setResultSpecificationMethods inherited from interface org.apache.uima.collection.CasConsumer
isReadOnlyMethods inherited from interface org.apache.uima.collection.base_cpm.CasObjectProcessor
processCas, processCas, typeSystemInitMethods inherited from interface org.apache.uima.collection.base_cpm.CasProcessor
batchProcessComplete, collectionProcessComplete, getProcessingResourceMetaData, isStatelessMethods inherited from interface org.apache.uima.resource.Resource
getUimaContext, getUimaContextAdmin
-
Constructor Details
-
AnalysisEngineProcessorAdapter
public AnalysisEngineProcessorAdapter()
-
-
Method Details
-
setStub
Sets the stub to be used to actual implementation. Subclasses must call this from theirinitializemethod.- Parameters:
aStub- the stub for the remote service
-
getStub
Gets the stub to be used to communicate with the remote service.- Returns:
- the stub for the remote service
-
getMetaData
Description copied from interface:ResourceGets the metadata that describes thisResource.- Specified by:
getMetaDatain interfaceResource- Overrides:
getMetaDatain classResource_ImplBase- Returns:
- an object containing all metadata for this resource.
- See Also:
-
destroy
public void destroy()Description copied from interface:ResourceReleases all resources held by thisResource.- Specified by:
destroyin interfaceResource- Overrides:
destroyin classResource_ImplBase- See Also:
-
processAndOutputNewCASes
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
-
reconfigure
Description 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:
-
getConfigParameterValue
Description copied from interface:ConfigurableResourceLooks up the value of a configuration parameter in a group. If the parameter has no value assigned within the group, fallback strategies will be followed.This method returns
nullif the parameter is optional and has not been assigned a value. (For mandatory parameters, an exception is thrown during initialization if no value has been assigned.) This method also returnsnullif there is no declared configuration parameter with the specified name.- Specified by:
getConfigParameterValuein interfaceConfigurableResource- Overrides:
getConfigParameterValuein classConfigurableResource_ImplBase- Parameters:
aGroupName- the name of a configuration group. If the group name isnull, this method will return the same value asgetParameterValue(String).aParamName- the name of a parameter in the group- Returns:
- the value of the parameter in group
aGroupNamewith nameaParamName,,nullis either the parameter does not exist or it has not been assigned a value. - See Also:
-
getConfigParameterValue
Description copied from interface:ConfigurableResourceLooks up the value of a configuration parameter. This method will only return the value of a parameter that is not defined in any group.This method returns
nullif the parameter is optional and has not been assigned a value. (For mandatory parameters, an exception is thrown during initialization if no value has been assigned.) This method also returnsnullif there is no declared configuration parameter with the specified name.- Specified by:
getConfigParameterValuein interfaceConfigurableResource- Overrides:
getConfigParameterValuein classConfigurableResource_ImplBase- Parameters:
aParamName- the name of a parameter that is not in any group- Returns:
- the value of the parameter with name
aParamName,nullis either the parameter does not exist or it has not been assigned a value. - See Also:
-
setConfigParameterValue
Description copied from interface:ConfigurableResourceSets the value of a configuration parameter. This only works for a parameter that is not defined in any group. Note that there is no guarantee that the change will take effect untilConfigurableResource.reconfigure()is called.- Specified by:
setConfigParameterValuein interfaceConfigurableResource- Overrides:
setConfigParameterValuein classConfigurableResource_ImplBase- Parameters:
aParamName- the name of a parameter that is not in any groupaValue- the value to assign to the parameter- See Also:
-
setConfigParameterValue
Description copied from interface:ConfigurableResourceSets the value of a configuration parameter in a group. Note that there is no guarantee that the change will take effect untilConfigurableResource.reconfigure()is called.- Specified by:
setConfigParameterValuein interfaceConfigurableResource- Overrides:
setConfigParameterValuein classConfigurableResource_ImplBase- Parameters:
aGroupName- the name of a configuration group. If this parameter isnull, this method will have the same effect assetParameterValue(String,Object).aParamName- the name of a parameter in the groupaValue- the value to assign to the parameter.- See Also:
-
batchProcessComplete
Description 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
Description 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
-
getResourceName
Gets the name of this resource, for use in logging and trace messages.- Returns:
- the name of this resource
-