public class PearAnalysisEngineWrapper extends AnalysisEngineImplBase
| Modifier and Type | Class and Description |
|---|---|
static class |
PearAnalysisEngineWrapper.StringPair
inner class StringPair
|
LOG_RESOURCE_BUNDLE, PARAM_VERIFICATION_MODEMDC_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_PERIODPARAM_AGGREGATE_SOFA_MAPPINGS, PARAM_CONFIG_MANAGER, PARAM_EXTERNAL_OVERRIDE_SETTINGS, PARAM_PERFORMANCE_TUNING_SETTINGS, PARAM_UIMA_CONTEXT| Constructor and Description |
|---|
PearAnalysisEngineWrapper() |
| Modifier and Type | Method and Description |
|---|---|
void |
batchProcessComplete()
Notifies this AnalysisEngine that processing of a batch has completed.
|
void |
batchProcessComplete(ProcessTrace trace)
Completes the processing of a batch.
|
protected void |
buildProcessTraceFromMBeanStats(ProcessTrace trace)
Modify an existing ProcessTrace object by adding events that represent the last excecution of
this AnalysisEngine.
|
void |
collectionProcessComplete()
Notifies this AnalysisEngine that processing of an entire collection has completed.
|
void |
collectionProcessComplete(ProcessTrace trace)
Completes the processing of an entire collection.
|
ResultSpecification |
createResultSpecification()
A factory method used to create an instance of
ResultSpecification for use with this
AnalysisEngine. |
ResultSpecification |
createResultSpecification(TypeSystem typeSystem)
A factory method used to create an instance of
ResultSpecification for use with this
AnalysisEngine. |
void |
destroy()
Releases all resources held by this
Resource. |
protected void |
enterBatchProcessComplete() |
protected void |
enterCollectionProcessComplete() |
protected void |
enterProcess() |
protected void |
exitBatchProcessComplete() |
protected void |
exitCollectionProcessComplete() |
protected void |
exitProcess() |
AnalysisEngineMetaData |
getAnalysisEngineMetaData()
Gets the metadata that describes this
AnalysisEngine. |
static Map<ResourceManager,Map<PearAnalysisEngineWrapper.StringPair,ResourceManager>> |
getCachedResourceManagers() |
protected String |
getMBeanNamePrefix() |
protected Object |
getMBeanServer() |
ResourceMetaData |
getMetaData()
Gets the metadata that describes this
Resource. |
Properties |
getPerformanceTuningSettings()
Gets the performance tuning settings in effect for this Analysis Engine.
|
ProcessingResourceMetaData |
getProcessingResourceMetaData()
Gets the metadata that describes this
CasProcesor. |
UimaContext |
getUimaContext()
Gets the UIMA Context for this Resource.
|
UimaContextAdmin |
getUimaContextAdmin()
Gets the Admin interface to this Resource's UimaContext.
|
boolean |
initialize(ResourceSpecifier aSpecifier,
Map<String,Object> aAdditionalParams)
Initializes this
Resource from a ResourceSpecifier. |
protected boolean |
isProcessTraceEnabled()
Gets whether the Process Trace (which collects performance stats for this AnalysisEngine) is
enabled.
|
CAS |
newCAS()
Creates a new Common Analysis System appropriate for this Analysis Engine.
|
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.
|
protected void |
setMetaData(ResourceMetaData aMetaData)
Sets the
ResourceMetaData object associated with this Resource. |
protected void |
setPerformanceTuningSettings(Properties aSettings)
Sets the performance tuning settings in effect for this Analysis Engine.
|
void |
setResultSpecification(ResultSpecification resultSpec)
Sets the list of output types and features that the application wants this AnalysisEngine to
produce.
|
void |
typeSystemInit(TypeSystem typeSystem)
From the CAS Processor interface.
|
buildProcessTraceFromMBeanStats, callInitializeMethod, callProcessMethod, finalize, getCurrentConfigParameterSettings, getFeatureNamesForType, getManagementInterface, getMBean, isReadOnly, isStateless, newJCas, normalizeIsoLangCodes, process, process, process, process, process, process, process, processAndOutputNewCASes, processCas, processCas, resetResultSpecificationToDefaultgetConfigParameterValue, getConfigParameterValue, setConfigParameterValue, setConfigParameterValuegetCasManager, getLogger, getRelativePathResolver, getResourceManager, loadUserClass, loadUserClassOrThrow, setContextHolder, setContextHolderX, setLogger, withContextHolderclone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetLogger, getResourceManager, setLoggergetConfigParameterValue, getConfigParameterValue, setConfigParameterValue, setConfigParameterValuepublic boolean initialize(ResourceSpecifier aSpecifier, Map<String,Object> aAdditionalParams) throws ResourceInitializationException
ResourceResource from a ResourceSpecifier. Applications do
not need to call this method. It is called automatically by the ResourceFactory
and cannot be called a second time.initialize in interface AnalysisEngineinitialize in interface Resourceinitialize in class AnalysisEngineImplBaseaSpecifier - specifies how to create a resource or locate an existing resource service.aAdditionalParams - a Map containing additional parameters. May be null if there are no
parameters. Each class that implements this interface can decide what additional
parameters it supports.ResourceSpecifier is not of an appropriate type for this Resource. If the
ResourceSpecifier is of an appropriate type but is invalid or if some
other failure occurs, an exception should be thrown.ResourceInitializationException - if a failure occurs during initialization.multi-thread safe, given that each instance of this class is only called on one thread,
once. The critical parts that update shared information (in shared uima context) are
inside a synchronize blockpublic AnalysisEngineMetaData getAnalysisEngineMetaData()
AnalysisEngineAnalysisEngine. This is just a convenience
method that calls Resource.getMetaData() and casts the result to a
AnalysisEngineMetaData.getAnalysisEngineMetaData in interface AnalysisEnginegetAnalysisEngineMetaData in class AnalysisEngineImplBaseAnalysisEngine.getAnalysisEngineMetaData()public ResourceMetaData getMetaData()
ResourceResource.getMetaData in interface ResourcegetMetaData in class Resource_ImplBaseResource.getMetaData()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 processingpublic 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 destroy()
ResourceResource.destroy in interface Resourcedestroy in class Resource_ImplBaseResource.destroy()public void reconfigure()
throws ResourceConfigurationException
ConfigurableResourcereconfigure in interface AnalysisEnginereconfigure in interface ConfigurableResourcereconfigure in class ConfigurableResource_ImplBaseResourceConfigurationException - if the configuration is not validConfigurableResource.reconfigure()protected void buildProcessTraceFromMBeanStats(ProcessTrace trace)
AnalysisEngineImplBasebuildProcessTraceFromMBeanStats in class AnalysisEngineImplBasetrace - -protected void enterBatchProcessComplete()
enterBatchProcessComplete in class AnalysisEngineImplBaseprotected void enterCollectionProcessComplete()
enterCollectionProcessComplete in class AnalysisEngineImplBaseprotected void enterProcess()
enterProcess in class AnalysisEngineImplBaseprotected void exitBatchProcessComplete()
exitBatchProcessComplete in class AnalysisEngineImplBaseprotected void exitCollectionProcessComplete()
exitCollectionProcessComplete in class AnalysisEngineImplBaseprotected void exitProcess()
exitProcess in class AnalysisEngineImplBaseprotected String getMBeanNamePrefix()
getMBeanNamePrefix in class AnalysisEngineImplBaseprotected Object getMBeanServer()
getMBeanServer in class AnalysisEngineImplBasepublic Properties getPerformanceTuningSettings()
AnalysisEngineImplBasegetPerformanceTuningSettings in interface AnalysisEnginegetPerformanceTuningSettings in class AnalysisEngineImplBaseprotected boolean isProcessTraceEnabled()
AnalysisEngineImplBaseisProcessTraceEnabled in class AnalysisEngineImplBaseprotected void setPerformanceTuningSettings(Properties aSettings)
AnalysisEngineImplBasesetPerformanceTuningSettings in class AnalysisEngineImplBaseaSettings - performance tuning settingspublic UimaContext getUimaContext()
ResourcegetUimaContext in interface ResourcegetUimaContext in class Resource_ImplBasepublic UimaContextAdmin getUimaContextAdmin()
Resource_ImplBasegetUimaContextAdmin in interface ResourcegetUimaContextAdmin in class Resource_ImplBaseprotected void setMetaData(ResourceMetaData aMetaData)
Resource_ImplBaseResourceMetaData object associated with this Resource. Any
previously existing metadata will be replaced.
Resource subclasses should call this method during initialization in order to set the metadata
before any calls to Resource_ImplBase.getMetaData() are made.
setMetaData in class AnalysisEngineImplBaseaMetaData - metadata to assign to this Resourcepublic void setResultSpecification(ResultSpecification resultSpec)
AnalysisEnginesetResultSpecification in interface AnalysisEnginesetResultSpecification in class AnalysisEngineImplBaseresultSpec - specifies the list of output types and features that the application is interested in.public void batchProcessComplete(ProcessTrace trace) throws ResourceProcessException, IOException
CasProcessorbatchProcessComplete in interface CasProcessorbatchProcessComplete in class AnalysisEngineImplBasetrace - an object that records information, such as timing, about this method's execution.ResourceProcessException - if an exception occurs during processingIOException - if an I/O failure occurspublic void collectionProcessComplete(ProcessTrace trace) throws ResourceProcessException, IOException
CasProcessorcollectionProcessComplete in interface CasProcessorcollectionProcessComplete in class AnalysisEngineImplBasetrace - an object that records information, such as timing, about this method's execution.ResourceProcessException - if an exception occurs during processingIOException - if an I/O failure occurspublic ResultSpecification createResultSpecification()
AnalysisEngine
A factory method used to create an instance of ResultSpecification for use with this
AnalysisEngine. Applications use this method to construct ResultSpecifications to
pass to this AnalysisEngine's AnalysisEngine.setResultSpecification(ResultSpecification) method.
See also AnalysisEngine.createResultSpecification(TypeSystem) which should be used if the type system
associated with this result specification is known at this point in time.
createResultSpecification in interface AnalysisEnginecreateResultSpecification in class AnalysisEngineImplBaseResultSpecificationAnalysisEngine.createResultSpecification()public ResultSpecification createResultSpecification(TypeSystem typeSystem)
AnalysisEngineResultSpecification for use with this
AnalysisEngine. Applications use this method to construct ResultSpecifications to
pass to this AnalysisEngine's AnalysisEngine.setResultSpecification(ResultSpecification) method.createResultSpecification in interface AnalysisEnginecreateResultSpecification in class AnalysisEngineImplBasetypeSystem - the type systemResultSpecificationAnalysisEngine.createResultSpecification(TypeSystem)public ProcessingResourceMetaData getProcessingResourceMetaData()
CasProcessorCasProcesor.getProcessingResourceMetaData in interface CasProcessorgetProcessingResourceMetaData in class AnalysisEngineImplBaseCasProcessor.getProcessingResourceMetaData()public CAS newCAS() throws ResourceInitializationException
AnalysisEngineAnalysisEngine.process(CAS) method. Then, when the process
method returns, the CAS will contain the results of the analysis.
Important: CAS creation is expensive, so if at all possible an application should reuse
CASes. When a CAS instance is no longer being used, call its CAS.reset() method, which
will remove all prior analysis information, and then reuse that same CAS instance for another
call to AnalysisEngine.process(CAS).
Note that the CAS allows multiple subjects of analysis (e.g. documents) and defines a separate
"view" for each of them. If your application wants to work with a single subject of analysis,
call the method CAS.getCurrentView() and operate on the returned view.
newCAS in interface AnalysisEnginenewCAS in class AnalysisEngineImplBaseCAS appropriate for this AnalysisEngine.ResourceInitializationException - if a CAS could not be created because this AnalysisEngine's CAS metadata (type
system, type priorities, or FS indexes) are invalid. Ideally this would be checked at
AnalysisEngine initialization time, and it will likely be moved in the future.AnalysisEngine.newCAS()public void typeSystemInit(TypeSystem typeSystem) throws ResourceInitializationException
AnalysisEngineImplBasetypeSystemInit in interface CasObjectProcessortypeSystemInit in class AnalysisEngineImplBasetypeSystem - the type system to useResourceInitializationException - if the type system is not compatible with this Cas ConsumerCasObjectProcessor.typeSystemInit(org.apache.uima.cas.TypeSystem)public static Map<ResourceManager,Map<PearAnalysisEngineWrapper.StringPair,ResourceManager>> getCachedResourceManagers()
Copyright © 2006–2022 The Apache Software Foundation. All rights reserved.