org.apache.uima.uimacpp
Class UimacppAnalysisComponent

java.lang.Object
  extended by org.apache.uima.analysis_component.AnalysisComponent_ImplBase
      extended by org.apache.uima.uimacpp.UimacppAnalysisComponent
All Implemented Interfaces:
AnalysisComponent

public class UimacppAnalysisComponent
extends AnalysisComponent_ImplBase


Constructor Summary
UimacppAnalysisComponent(ResourceCreationSpecifier aeDescription, org.apache.uima.analysis_engine.impl.AnalysisEngineImplBase ae)
           
 
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  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)
           
 
Methods inherited from class org.apache.uima.analysis_component.AnalysisComponent_ImplBase
getContext, getResultSpecification, setResultSpecification
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UimacppAnalysisComponent

public UimacppAnalysisComponent(ResourceCreationSpecifier aeDescription,
                                org.apache.uima.analysis_engine.impl.AnalysisEngineImplBase ae)
Method Detail

initialize

public void initialize(UimaContext context)
                throws ResourceInitializationException
Description copied from interface: AnalysisComponent
Performs any startup tasks required by this component. The framework calls this method only once, just after the AnalysisComponent has been instantiated.

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.

Specified by:
initialize in interface AnalysisComponent
Overrides:
initialize in class AnalysisComponent_ImplBase
Parameters:
context - Provides access to services and resources managed by the framework. This includes configuration parameters, logging, and access to external resources.
Throws:
ResourceInitializationException
See Also:
org.apache.uima.analysis_engine.annotator.BaseAnnotator#initialize(org.apache.uima.cas.CAS, org.apache.uima.analysis_engine.annotator.AnnotatorContext)

typeSystemInit

public void typeSystemInit(TypeSystem ts)
                    throws AnnotatorConfigurationException,
                           AnnotatorInitializationException
Throws:
AnnotatorConfigurationException
AnnotatorInitializationException
See Also:
org.apache.uima.analysis_engine.annotator.BaseAnnotator#typeSystemInit()

reconfigure

public void reconfigure()
Description copied from class: AnalysisComponent_ImplBase
Notifies this AnalysisComponent that its configuration parameters have changed. This implementation just calls AnalysisComponent_ImplBase.destroy() followed by AnalysisComponent_ImplBase.initialize(UimaContext). Subclasses can override to provide more efficient reconfiguration logic if necessary.

Specified by:
reconfigure in interface AnalysisComponent
Overrides:
reconfigure in class AnalysisComponent_ImplBase
See Also:
org.apache.uima.analysis_engine.annotator.BaseAnnotator#reconfigure(java.lang.String[])

process

public void process(CAS cas,
                    ResultSpecification aResultSpec)
             throws AnnotatorProcessException
Throws:
AnnotatorProcessException
See Also:
org.apache.uima.analysis_engine.annotator.BaseAnnotator#process(org.apache.uima.analysis_engine.ResultSpecification)

process

public void process(CAS aCAS)
             throws AnalysisEngineProcessException
Throws:
AnalysisEngineProcessException

process

public void process(AbstractCas aCAS)
             throws AnalysisEngineProcessException
Description copied from interface: AnalysisComponent
Inputs a CAS to the AnalysisComponent. The AnalysisComponent "owns" this CAS until such time as AnalysisComponent.hasNext() is called and returns false or until process is called again (see class description).

Parameters:
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.
Throws:
AnalysisEngineProcessException - if a problem occurs during processing

hasNext

public boolean hasNext()
                throws AnalysisEngineProcessException
Description copied from interface: AnalysisComponent
Asks if this AnalysisComponent has another CAS to output. If this method returns true, then a call to 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.

Returns:
true if this AnalysisComponent has another CAS to output, false if not.
Throws:
AnalysisEngineProcessException - if a problem occurs during processing

next

public AbstractCas next()
                 throws AnalysisEngineProcessException
Description copied from interface: AnalysisComponent
Gets the next output CAS. The framework will only call this method after first calling 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).

Returns:
the next output CAS.
Throws:
AnalysisEngineProcessException - if a problem occurs during processing

getRequiredCasInterface

public Class<CAS> getRequiredCasInterface()
Description copied from interface: AnalysisComponent
Returns the specific CAS interface that this AnalysisComponent requires the framework to pass to its AnalysisComponent.process(AbstractCas) method.

Returns:
the required CAS interface. This must specify a subtype of AbstractCas.

getCasInstancesRequired

public int getCasInstancesRequired()
Description copied from interface: AnalysisComponent
Returns the maximum number of CAS instances that this AnalysisComponent expects to use at the same time. This only applies to CasMultipliers. Most CasMultipliers will only need one CAS at a time. Only if there is a clear need should this be overridden to return something greater than 1.

Returns:
the number of CAS instances required by this AnalysisComponent.

batchProcessComplete

public void batchProcessComplete()
                          throws AnalysisEngineProcessException
Description copied from interface: AnalysisComponent
Completes the processing of a batch of CASes. The size of a batch is determined based on configuration provided by the application that is using this component. The purpose of 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.

Specified by:
batchProcessComplete in interface AnalysisComponent
Overrides:
batchProcessComplete in class AnalysisComponent_ImplBase
Throws:
AnalysisEngineProcessException - if this component encounters a problem in flushing its state to persistent storage

collectionProcessComplete

public void collectionProcessComplete()
                               throws AnalysisEngineProcessException
Description copied from interface: AnalysisComponent
Notifies this AnalysisComponent that processing of an entire collection has been completed. In this method, this component should finish writing any output relating to the current collection.

Specified by:
collectionProcessComplete in interface AnalysisComponent
Overrides:
collectionProcessComplete in class AnalysisComponent_ImplBase
Throws:
AnalysisEngineProcessException - if this component encounters a problem in its end-of-collection processing

destroy

public void destroy()
Description copied from interface: AnalysisComponent
Frees all resources held by this AnalysisComponent. The framework calls this method only once, when it is finished using this component.

Specified by:
destroy in interface AnalysisComponent
Overrides:
destroy in class AnalysisComponent_ImplBase
See Also:
BaseAnnotator.destroy()

finalize

protected void finalize()
                 throws Throwable
Overrides:
finalize in class Object
Throws:
Throwable

getLoggingLevel

public static int getLoggingLevel()
Get the logging level of the logger for TAFAnnotator. TAF only supports three levels of logging. All logging levels INFO and below are mapped to the TAF message level.


log

public static void log(int msglevel,
                       String sourceClass,
                       String sourceMethod,
                       String message)

getEmptyCAS

protected CAS getEmptyCAS()


Copyright © 2010 The Apache Software Foundation. All Rights Reserved.