|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.uima.resource.Resource_ImplBase org.apache.uima.resource.ConfigurableResource_ImplBase org.apache.uima.collection.CasConsumer_ImplBase
public abstract class CasConsumer_ImplBase
Base class for CAS Consumers in UIMA SDK v1.x, which developers should extend with their own CAS Consumer implementation classes. As of v2.0, there is no difference in capability between CAS Consumers and ordinary Analysis Engines, except for the default setting of the XML parameters for multipleDeploymentAllowed and modifiesCas. We recommend for future work that users implement and use Analysis Engine components instead of CAS Consumers.
Field Summary |
---|
Fields inherited from interface org.apache.uima.resource.Resource |
---|
PARAM_AGGREGATE_SOFA_MAPPINGS, PARAM_CONFIG_PARAM_SETTINGS, PARAM_PERFORMANCE_TUNING_SETTINGS, PARAM_RESOURCE_MANAGER, PARAM_UIMA_CONTEXT |
Constructor Summary | |
---|---|
CasConsumer_ImplBase()
|
Method Summary | |
---|---|
void |
batchProcessComplete(ProcessTrace arg0)
Completes the processing of a batch. |
void |
collectionProcessComplete(ProcessTrace arg0)
Completes the processing of an entire collection. |
void |
destroy()
Releases all resources held by this Resource . |
ProcessingResourceMetaData |
getProcessingResourceMetaData()
Gets the metadata that describes this CasProcesor . |
void |
initialize()
This method is called during initialization, and does nothing by default. |
boolean |
initialize(ResourceSpecifier aSpecifier,
Map<String,Object> aAdditionalParams)
Called by the framework to initialize this CAS Consumer. |
boolean |
isReadOnly()
Returns true. |
boolean |
isStateless()
Gets whether this is a stateless CAS Processor. |
void |
processCas(CAS[] aCASes)
Processes multiple CASes. |
void |
reconfigure()
Notifies this CAS Consumer that its configuration parameter settings have been changed. |
void |
typeSystemInit(TypeSystem arg0)
Informs this CasConsumer that the CAS TypeSystem has changed. |
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, getResourceManager, getUimaContext, getUimaContextAdmin, setLogger, setMetaData |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.uima.resource.ConfigurableResource |
---|
getConfigParameterValue, getConfigParameterValue, setConfigParameterValue, setConfigParameterValue |
Methods inherited from interface org.apache.uima.resource.Resource |
---|
getLogger, getMetaData, getResourceManager, getUimaContext, getUimaContextAdmin, setLogger |
Methods inherited from interface org.apache.uima.collection.base_cpm.CasObjectProcessor |
---|
processCas |
Constructor Detail |
---|
public CasConsumer_ImplBase()
Method Detail |
---|
public boolean initialize(ResourceSpecifier aSpecifier, Map<String,Object> aAdditionalParams) throws ResourceInitializationException
initialize()
method and access
metadata via the getProcessingResourceMetaData()
method. This method is non-final only
for legacy reasons.
initialize
in interface Resource
initialize
in class Resource_ImplBase
aSpecifier
- 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.Resource.initialize(org.apache.uima.resource.ResourceSpecifier,
java.util.Map)
public void initialize() throws ResourceInitializationException
ResourceInitializationException
- if a failure occurs during initialization.public void destroy()
Resource
Resource
.
destroy
in interface Resource
destroy
in class Resource_ImplBase
Resource.destroy()
public void typeSystemInit(TypeSystem arg0) throws ResourceInitializationException
CasObjectProcessor
In this method, the CasConsumer should use the TypeSystem
to resolve the names of Type
and Features to the actual Type
and
Feature
objects, which can then be used during processing.
typeSystemInit
in interface CasObjectProcessor
ResourceInitializationException
CasObjectProcessor.typeSystemInit(org.apache.uima.cas.TypeSystem)
public void processCas(CAS[] aCASes) throws ResourceProcessException
CasObjectProcessor
processCas
in interface CasObjectProcessor
aCASes
- an array of CASes to be processed. Additional information may be added to these CASes
(if this CAS processor is not read-only
).
ResourceProcessException
- if processing fails for any of the CASesCasObjectProcessor.processCas(org.apache.uima.cas.CAS[])
public boolean isStateless()
CasProcessor
isStateless
in interface CasProcessor
CasProcessor.isStateless()
public final boolean isReadOnly()
isReadOnly
in interface CasProcessor
isReadOnly
in interface CasConsumer
CasProcessor.isReadOnly()
public ProcessingResourceMetaData getProcessingResourceMetaData()
CasProcessor
CasProcesor
.
getProcessingResourceMetaData
in interface CasProcessor
CasProcessor.getProcessingResourceMetaData()
public void batchProcessComplete(ProcessTrace arg0) throws ResourceProcessException, IOException
CasProcessor
batchProcessComplete
in interface CasProcessor
arg0
- an object that records information, such as timing, about this method's execution.
ResourceProcessException
- if an exception occurs during processing
IOException
- if an I/O failure occursCasProcessor.batchProcessComplete(org.apache.uima.util.ProcessTrace)
public void collectionProcessComplete(ProcessTrace arg0) throws ResourceProcessException, IOException
CasProcessor
collectionProcessComplete
in interface CasProcessor
arg0
- an object that records information, such as timing, about this method's execution.
ResourceProcessException
- if an exception occurs during processing
IOException
- if an I/O failure occursCasProcessor.collectionProcessComplete(org.apache.uima.util.ProcessTrace)
public void reconfigure() throws ResourceConfigurationException
destroy()
followed by initialize()
. CAS
Consumers that have expensive initialization that does not need to be redone whenever
configuration parameters change may wish to override this method to provide a more efficient
implementation.
reconfigure
in interface ConfigurableResource
reconfigure
in class ConfigurableResource_ImplBase
ResourceConfigurationException
- if the configuration is not validConfigurableResource_ImplBase.reconfigure()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |