public abstract class AnalysisComponent_ImplBase extends Object implements AnalysisComponent
This class implements the initialize(UimaContext) method and stores the
UimaContext in a private field where it can be accessed via the
getContext() method.
This class also provides a "dumb" implementation of the reconfigure() method, which
simply calls destroy() followed by initialize(UimaContext). Developers of
AnalysisComponents with expensive initialization logic should override this method and provide a
more intelligent implementation.
| Constructor and Description |
|---|
AnalysisComponent_ImplBase() |
| Modifier and Type | Method and Description |
|---|---|
void |
batchProcessComplete()
Completes the processing of a batch of CASes.
|
void |
collectionProcessComplete()
Notifies this AnalysisComponent that processing of an entire collection has been completed.
|
void |
destroy()
Frees all resources held by this AnalysisComponent.
|
protected UimaContext |
getContext()
Gets the UimaContext for this AnalysisComponent.
|
protected ResultSpecification |
getResultSpecification()
Gets the ResultSpecification for this AnalysisComponent.
|
void |
initialize(UimaContext aContext)
Performs any startup tasks required by this component.
|
void |
reconfigure()
Notifies this AnalysisComponent that its configuration parameters have changed.
|
void |
setResultSpecification(ResultSpecification aResultSpec)
Sets the Result Specification for this Analysis Component.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetCasInstancesRequired, getRequiredCasInterface, hasNext, next, processpublic void initialize(UimaContext aContext) throws ResourceInitializationException
AnalysisComponent
The framework supplies this AnalysisComponent with a reference to the UimaContext that
it will use, for example to access configuration settings or resources. This AnalysisComponent
should store a reference to its the UimaContext for later use.
initialize in interface AnalysisComponentaContext - Provides access to services and resources managed by the framework. This includes
configuration parameters, logging, and access to external resources.ResourceInitializationException - if this AnalysisComponent cannot initialize successfully.public void reconfigure()
throws ResourceConfigurationException,
ResourceInitializationException
destroy() followed by initialize(UimaContext). Subclasses can
override to provide more efficient reconfiguration logic if necessary.reconfigure in interface AnalysisComponentResourceConfigurationException - if the configuration specified for this component is invalid.ResourceInitializationException - if this component fails to reinitialize itself based on the new configuration.AnalysisComponent.reconfigure()public void batchProcessComplete()
throws AnalysisEngineProcessException
AnalysisComponentbatchProcessComplete is to give this AnalysisComponent the change to flush
information from memory to persistent storage. In the event of an error, this allows the
processing to be restarted from the end of the last completed batch.
If this component's descriptor declares that it is recoverable, then this
component is required to be restartable from the end of the last completed batch.
batchProcessComplete in interface AnalysisComponentAnalysisEngineProcessException - if this component encounters a problem in flushing its state to persistent storagepublic void collectionProcessComplete()
throws AnalysisEngineProcessException
AnalysisComponentcollectionProcessComplete in interface AnalysisComponentAnalysisEngineProcessException - if this component encounters a problem in its end-of-collection processingpublic void destroy()
AnalysisComponentdestroy in interface AnalysisComponentpublic void setResultSpecification(ResultSpecification aResultSpec)
getResultSpecification(). An AnalysisComponent implementation may override this
method if it would like to do specific processing when its ResultSpecificatin is changed.setResultSpecification in interface AnalysisComponentaResultSpec - the ResultSpecification for this Analysis Component to use.AnalysisComponent.setResultSpecification(ResultSpecification)protected final UimaContext getContext()
protected ResultSpecification getResultSpecification()
Copyright © 2006–2017 The Apache Software Foundation. All rights reserved.