public class UimacppAnalysisComponent extends AnalysisComponent_ImplBase
Constructor and Description |
---|
UimacppAnalysisComponent(ResourceCreationSpecifier aeDescription,
org.apache.uima.analysis_engine.impl.AnalysisEngineImplBase ae) |
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 void |
finalize() |
int |
getCasInstancesRequired()
Returns the maximum number of CAS instances that this AnalysisComponent expects to use at the
same time.
|
protected CAS |
getEmptyCAS() |
static int |
getLoggingLevel()
Get the logging level of the logger for TAFAnnotator.
|
Class<CAS> |
getRequiredCasInterface()
Returns the specific CAS interface that this AnalysisComponent requires the framework to pass
to its
AnalysisComponent.process(AbstractCas) method. |
boolean |
hasNext()
Asks if this AnalysisComponent has another CAS to output.
|
void |
initialize(UimaContext context)
Performs any startup tasks required by this component.
|
static void |
log(int msglevel,
String sourceClass,
String sourceMethod,
String message) |
AbstractCas |
next()
Gets the next output CAS.
|
void |
process(AbstractCas aCAS)
Inputs a CAS to the AnalysisComponent.
|
void |
process(CAS aCAS) |
void |
process(CAS cas,
ResultSpecification aResultSpec) |
void |
reconfigure()
Notifies this AnalysisComponent that its configuration parameters have changed.
|
void |
typeSystemInit(TypeSystem ts) |
getContext, getResultSpecification, setResultSpecification
public UimacppAnalysisComponent(ResourceCreationSpecifier aeDescription, org.apache.uima.analysis_engine.impl.AnalysisEngineImplBase ae)
public void initialize(UimaContext context) 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
initialize
in class AnalysisComponent_ImplBase
context
- the UIMA ContextResourceInitializationException
- wraps exceptions thrown from called routinesAnalysisComponent.initialize(org.apache.uima.UimaContext)
public void typeSystemInit(TypeSystem ts) throws AnnotatorConfigurationException, AnnotatorInitializationException
ts
- TypeSystem to use in the initializationAnnotatorConfigurationException
- pass thruAnnotatorInitializationException
- pass thruCasAnnotator_ImplBase.typeSystemInit(TypeSystem)
public void reconfigure()
AnalysisComponent_ImplBase
AnalysisComponent_ImplBase.destroy()
followed by AnalysisComponent_ImplBase.initialize(UimaContext)
. Subclasses can
override to provide more efficient reconfiguration logic if necessary.reconfigure
in interface AnalysisComponent
reconfigure
in class AnalysisComponent_ImplBase
AnalysisComponent.reconfigure()
public void process(CAS cas, ResultSpecification aResultSpec) throws AnnotatorProcessException
cas
- the CAS to processaResultSpec
- the Result Specification to useAnnotatorProcessException
- wraps exceptions thrown from called methodsGenericAnnotator.process(CAS, ResultSpecification)
public void process(CAS aCAS) throws AnalysisEngineProcessException
AnalysisEngineProcessException
public void process(AbstractCas aCAS) throws AnalysisEngineProcessException
AnalysisComponent
AnalysisComponent.hasNext()
is called and returns false or until process
is called again
(see class description).aCAS
- A CAS that this AnalysisComponent should process. The framework will ensure that aCAS
implements the specific CAS interface specified by the
AnalysisComponent.getRequiredCasInterface()
method.AnalysisEngineProcessException
- if a problem occurs during processingpublic boolean hasNext() throws AnalysisEngineProcessException
AnalysisComponent
AnalysisComponent.next()
should retrieve the next output CAS. When this method returns false,
the AnalysisComponent gives up control of the initial CAS that was passed to its
AnalysisComponent.process(AbstractCas)
method.AnalysisEngineProcessException
- if a problem occurs during processingpublic AbstractCas next() throws AnalysisEngineProcessException
AnalysisComponent
AnalysisComponent.hasNext()
and checking that it returns true.
The AnalysisComponent can obtain a new CAS by calling UimaContext.getEmptyCas(Class)
(or instead, one of the helper methods in the ImplBase class that it extended).
AnalysisEngineProcessException
- if a problem occurs during processingpublic Class<CAS> getRequiredCasInterface()
AnalysisComponent
AnalysisComponent.process(AbstractCas)
method.AbstractCas
.public int getCasInstancesRequired()
AnalysisComponent
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
batchProcessComplete
in class AnalysisComponent_ImplBase
AnalysisEngineProcessException
- if this component encounters a problem in flushing its state to persistent storagepublic void collectionProcessComplete() throws AnalysisEngineProcessException
AnalysisComponent
collectionProcessComplete
in interface AnalysisComponent
collectionProcessComplete
in class AnalysisComponent_ImplBase
AnalysisEngineProcessException
- if this component encounters a problem in its end-of-collection processingpublic void destroy()
AnalysisComponent
destroy
in interface AnalysisComponent
destroy
in class AnalysisComponent_ImplBase
BaseAnnotator.destroy()
protected void finalize() throws Throwable
public static int getLoggingLevel()
protected CAS getEmptyCAS()
Copyright © 2006–2017 The Apache Software Foundation. All rights reserved.