|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.uima.analysis_component.AnalysisComponent_ImplBase
public abstract class AnalysisComponent_ImplBase
Implementation base class for AnalysisComponents. Normally developers do not extend this class directly. Instead extend one of the Annotator or CasMultiplier base classes.
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 Summary | |
---|---|
AnalysisComponent_ImplBase()
|
Method Summary | |
---|---|
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. |
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.analysis_component.AnalysisComponent |
---|
getCasInstancesRequired, getRequiredCasInterface, hasNext, next, process |
Constructor Detail |
---|
public AnalysisComponent_ImplBase()
Method Detail |
---|
public 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 AnalysisComponent
aContext
- 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 AnalysisComponent
ResourceConfigurationException
- 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
AnalysisComponent
batchProcessComplete
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 AnalysisComponent
AnalysisEngineProcessException
- if this component encounters a problem in flushing its state to persistent storagepublic void collectionProcessComplete() throws AnalysisEngineProcessException
AnalysisComponent
collectionProcessComplete
in interface AnalysisComponent
AnalysisEngineProcessException
- if this component encounters a problem in its end-of-collection processingpublic void destroy()
AnalysisComponent
destroy
in interface AnalysisComponent
public 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 AnalysisComponent
aResultSpec
- the ResultSpecification for this Analysis Component to use.AnalysisComponent.setResultSpecification(ResultSpecification)
protected final UimaContext getContext()
protected ResultSpecification getResultSpecification()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |