public abstract class AnalysisEngineServiceAdapter extends AnalysisEngineImplBase implements TextAnalysisEngine, CasConsumer
AnalysisEngine interface
by communicating with an Analysis Engine service. This insulates the application from having to
know whether it is calling a local AnalysisEngine or a remote service.
Subclasses must provide an implementation of the AnalysisEngineImplBase.initialize(ResourceSpecifier,Map)
method, which must create an AnalysisEngineServiceStub object that can communicate with the
remote service. The stub must be passed to the setStub(AnalysisEngineServiceStub) method of
this class.
LOG_RESOURCE_BUNDLE, PARAM_VERIFICATION_MODEPARAM_CONFIG_PARAM_SETTINGS, PARAM_MBEAN_NAME_PREFIX, PARAM_MBEAN_SERVER, PARAM_NUM_SIMULTANEOUS_REQUESTS, PARAM_RESOURCE_MANAGER, PARAM_TIMEOUT_PERIODPARAM_AGGREGATE_SOFA_MAPPINGS, PARAM_CONFIG_MANAGER, PARAM_EXTERNAL_OVERRIDE_SETTINGS, PARAM_PERFORMANCE_TUNING_SETTINGS, PARAM_UIMA_CONTEXT| Constructor and Description |
|---|
AnalysisEngineServiceAdapter() |
| Modifier and Type | Method and Description |
|---|---|
void |
batchProcessComplete()
Notifies this AnalysisEngine that processing of a batch has completed.
|
void |
collectionProcessComplete()
Notifies this AnalysisEngine that processing of an entire collection has completed.
|
void |
destroy()
Releases all resources held by this
Resource. |
Object |
getConfigParameterValue(String aParamName)
Looks up the value of a configuration parameter.
|
Object |
getConfigParameterValue(String aGroupName,
String aParamName)
Looks up the value of a configuration parameter in a group.
|
ResourceMetaData |
getMetaData()
Gets the metadata that describes this
Resource. |
protected String |
getResourceName()
Gets the name of this resource, for use in logging and trace messages.
|
protected AnalysisEngineServiceStub |
getStub()
Gets the stub to be used to communicate with the remote service.
|
CasIterator |
processAndOutputNewCASes(CAS aCAS)
Processes a CAS, possibly producing multiple CASes as a result.
|
void |
reconfigure()
Instructs this Resource to re-read its configuration parameter settings.
|
void |
setConfigParameterValue(String aParamName,
Object aValue)
Sets the value of a configuration parameter.
|
void |
setConfigParameterValue(String aGroupName,
String aParamName,
Object aValue)
Sets the value of a configuration parameter in a group.
|
protected void |
setStub(AnalysisEngineServiceStub aStub)
Sets the stub to be used to communicate with the remote service.
|
batchProcessComplete, buildProcessTraceFromMBeanStats, buildProcessTraceFromMBeanStats, 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, typeSystemInitgetCasManager, getLogger, getRelativePathResolver, getResourceManager, getUimaContext, getUimaContextAdmin, setLoggerclone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreateResultSpecification, createResultSpecification, getAnalysisEngineMetaData, getFeatureNamesForType, getLogger, getManagementInterface, getPerformanceTuningSettings, getResourceManager, initialize, newCAS, newJCas, process, process, process, process, process, process, process, processAndOutputNewCASes, setLogger, setResultSpecificationgetUimaContext, getUimaContextAdminprocessCas, processCas, typeSystemInitbatchProcessComplete, collectionProcessComplete, getProcessingResourceMetaData, isReadOnly, isStatelessisReadOnlyprotected void setStub(AnalysisEngineServiceStub aStub)
initialize method.aStub - the stub for the remote serviceprotected AnalysisEngineServiceStub getStub()
public ResourceMetaData getMetaData()
ResourceResource.getMetaData in interface ResourcegetMetaData in class Resource_ImplBaseResource.getMetaData()public void destroy()
ResourceResource.destroy in interface Resourcedestroy in class Resource_ImplBaseResource.destroy()public CasIterator processAndOutputNewCASes(CAS aCAS) throws AnalysisEngineProcessException
AnalysisEngineCasIterator interface to step through the output CASes.
If this Analysis Engine does not produce output CASes, then the CasIterator will
return no elements. You can check if an AnalysisEngine is capable of producing output CASes by
checking the
OperationalProperties.getOutputsNewCASes()
operational property (getAnalysisEngineMetaData().getOperationalProperties().getOutputsNewCASes()).
Once this method is called, the AnalysisEngine "owns" aCAS until such time as
the CasIterator.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
call CasIterator.release(), which will stop further processing from occurring, and
ownership of aCAS will revert to the caller.
processAndOutputNewCASes in interface AnalysisEngineprocessAndOutputNewCASes in class AnalysisEngineImplBaseaCAS - the CAS to be processedAnalysisEngineProcessException - if a failure occurs during processingpublic void reconfigure()
throws ResourceConfigurationException
ConfigurableResourcereconfigure in interface AnalysisEnginereconfigure in interface ConfigurableResourcereconfigure in class ConfigurableResource_ImplBaseResourceConfigurationException - if the configuration is not validConfigurableResource.reconfigure()public Object getConfigParameterValue(String aGroupName, String aParamName)
ConfigurableResource
This method returns null if 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 returns null if there is no declared
configuration parameter with the specified name.
getConfigParameterValue in interface ConfigurableResourcegetConfigParameterValue in class ConfigurableResource_ImplBaseaGroupName - the name of a configuration group. If the group name is
null, this method will return the same value as
getParameterValue(String).aParamName - the name of a parameter in the groupaGroupName with
name aParamName,,null is either the
parameter does not exist or it has not been assigned a value.ConfigurableResource.getConfigParameterValue(java.lang.String,
java.lang.String)public Object getConfigParameterValue(String aParamName)
ConfigurableResource
This method returns null if 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 returns null if there is no declared
configuration parameter with the specified name.
getConfigParameterValue in interface ConfigurableResourcegetConfigParameterValue in class ConfigurableResource_ImplBaseaParamName - the name of a parameter that is not in any groupaParamName, null is
either the parameter does not exist or it has not been assigned a value.ConfigurableResource.getConfigParameterValue(java.lang.String)public void setConfigParameterValue(String aParamName, Object aValue)
ConfigurableResourceConfigurableResource.reconfigure() is called.setConfigParameterValue in interface ConfigurableResourcesetConfigParameterValue in class ConfigurableResource_ImplBaseaParamName - the name of a parameter that is not in any groupaValue - the value to assign to the parameterConfigurableResource.setConfigParameterValue(java.lang.String,
java.lang.Object)public void setConfigParameterValue(String aGroupName, String aParamName, Object aValue)
ConfigurableResourceConfigurableResource.reconfigure() is called.setConfigParameterValue in interface ConfigurableResourcesetConfigParameterValue in class ConfigurableResource_ImplBaseaGroupName - the name of a configuration group. If this parameter is
null, this method will have the same effect as
setParameterValue(String,Object).aParamName - the name of a parameter in the groupaValue - the value to assign to the parameter.ConfigurableResource.setConfigParameterValue(java.lang.String,
java.lang.String, java.lang.Object)public void batchProcessComplete()
throws AnalysisEngineProcessException
AnalysisEnginebatchProcessComplete in interface AnalysisEnginebatchProcessComplete in class AnalysisEngineImplBaseAnalysisEngineProcessException - if an exception occurs during processingpublic void collectionProcessComplete()
throws AnalysisEngineProcessException
AnalysisEngine
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 fixedFlow or
capabilityLanguageFlow, 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 no fixedFlow or
capabilityLanguageFlow, then all components in the aggregate will be called in arbitrary order.
collectionProcessComplete in interface AnalysisEnginecollectionProcessComplete in class AnalysisEngineImplBaseAnalysisEngineProcessException - if an exception occurs during processingprotected String getResourceName()
Copyright © 2006–2021 The Apache Software Foundation. All rights reserved.