org.apache.uima.collection.impl.cpm
Class CPMImpl

java.lang.Object
  extended by org.apache.uima.collection.impl.cpm.BaseCPMImpl
      extended by org.apache.uima.collection.impl.cpm.CPMImpl
All Implemented Interfaces:
java.lang.Runnable, BaseCPM, CollectionProcessingManager

public class CPMImpl
extends BaseCPMImpl
implements CollectionProcessingManager


Field Summary
 
Fields inherited from class org.apache.uima.collection.impl.cpm.BaseCPMImpl
cpmThreadGroup
 
Fields inherited from interface org.apache.uima.collection.base_cpm.BaseCPM
DOCUMENT_TEXT_FEATURE, DOCUMENT_TEXT_TYPE
 
Constructor Summary
CPMImpl()
           
CPMImpl(ResourceManager aResourceManager)
           
 
Method Summary
 void addCasConsumer(CasConsumer aCasConsumer)
          Adds a CasConsumer to this CPM.
 void addStatusCallbackListener(StatusCallbackListener aListener)
          Registers a listsner to receive status callbacks.
 AnalysisEngine getAnalysisEngine()
          Gets the AnalysisEngine that is assigned to this CPM.
 CasConsumer[] getCasConsumers()
          Gets the CasConsumerss assigned to this CPM.
 void process(CollectionReader aCollectionReader)
          Initiates processing of a collection.
 void process(CollectionReader aCollectionReader, int aBatchSize)
          Initiates processing of a collection.
 void removeCasConsumer(CasConsumer aCasConsumer)
          Removes a CasConsumer from this CPM.
 void removeStatusCallbackListener(StatusCallbackListener aListener)
          Unregisters a status callback listener.
 void setAnalysisEngine(AnalysisEngine aAnalysisEngine)
          Sets the AnalysisEngine that is assigned to this CPM.
 
Methods inherited from class org.apache.uima.collection.impl.cpm.BaseCPMImpl
addCasProcessor, addCasProcessor, addStatusCallbackListener, asynchStop, buildEventTree, disableCasProcessor, displayStats, enableCasProcessor, finalizeIt, getCasProcessors, getCollectionReader, getCPEConfig, getDescriptor, getPerformanceReport, getProgress, getSynchPoint, init, isPaused, isPauseOnException, isProcessing, isSerialProcessingRequired, kill, pause, process, process, process, removeCasProcessor, removeStatusCallbackListener, resume, resume, run, setCollectionReader, setJediiReport, setPauseOnException, setPerformanceTuningSettings, setProcessControllerAdapter, setSerialProcessingRequired, stop
 
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.collection.CollectionProcessingManager
getPerformanceReport, getProgress, isPaused, isPauseOnException, isProcessing, isSerialProcessingRequired, pause, resume, resume, setPauseOnException, setSerialProcessingRequired, stop
 

Constructor Detail

CPMImpl

public CPMImpl()
        throws java.lang.Exception
Throws:
java.lang.Exception

CPMImpl

public CPMImpl(ResourceManager aResourceManager)
        throws java.lang.Exception
Throws:
java.lang.Exception
Method Detail

getAnalysisEngine

public AnalysisEngine getAnalysisEngine()
Description copied from interface: CollectionProcessingManager
Gets the AnalysisEngine that is assigned to this CPM.

Specified by:
getAnalysisEngine in interface CollectionProcessingManager
Returns:
the AnalysisEngine that this CPM will use to analyze each CAS in the collection.

setAnalysisEngine

public void setAnalysisEngine(AnalysisEngine aAnalysisEngine)
                       throws ResourceConfigurationException
Description copied from interface: CollectionProcessingManager
Sets the AnalysisEngine that is assigned to this CPM.

Specified by:
setAnalysisEngine in interface CollectionProcessingManager
Parameters:
aAnalysisEngine - the AnalysisEngine that this CPM will use to analyze each CAS in the collection.
Throws:
ResourceConfigurationException

getCasConsumers

public CasConsumer[] getCasConsumers()
Description copied from interface: CollectionProcessingManager
Gets the CasConsumerss assigned to this CPM.

Specified by:
getCasConsumers in interface CollectionProcessingManager
Returns:
an array of CasConsumers

addCasConsumer

public void addCasConsumer(CasConsumer aCasConsumer)
                    throws ResourceConfigurationException
Description copied from interface: CollectionProcessingManager
Adds a CasConsumer to this CPM.

Specified by:
addCasConsumer in interface CollectionProcessingManager
Parameters:
aCasConsumer - a CasConsumer to add
Throws:
ResourceConfigurationException

removeCasConsumer

public void removeCasConsumer(CasConsumer aCasConsumer)
Description copied from interface: CollectionProcessingManager
Removes a CasConsumer from this CPM.

Specified by:
removeCasConsumer in interface CollectionProcessingManager
Parameters:
aCasConsumer - the CasConsumer to remove

addStatusCallbackListener

public void addStatusCallbackListener(StatusCallbackListener aListener)
Description copied from interface: CollectionProcessingManager
Registers a listsner to receive status callbacks.

Specified by:
addStatusCallbackListener in interface CollectionProcessingManager
Parameters:
aListener - the listener to add

removeStatusCallbackListener

public void removeStatusCallbackListener(StatusCallbackListener aListener)
Description copied from interface: CollectionProcessingManager
Unregisters a status callback listener.

Specified by:
removeStatusCallbackListener in interface CollectionProcessingManager
Parameters:
aListener - the listener to remove

process

public void process(CollectionReader aCollectionReader)
             throws ResourceInitializationException
Description copied from interface: CollectionProcessingManager
Initiates processing of a collection. CollectionReader initializes the CAS with Documents from the Colection. This method starts the processing in another thread and returns immediately. Status of the processing can be obtained by registering a listener with the CollectionProcessingManager.addStatusCallbackListener(StatusCallbackListener) method.

A CPM can only process one collection at a time. If this method is called while a previous processing request has not yet completed, a UIMA_IllegalStateException will result. To find out whether a CPM is free to begin another processing request, call the CollectionProcessingManager.isProcessing() method.

Specified by:
process in interface CollectionProcessingManager
Parameters:
aCollectionReader - the CollectionReader from which to obtain the Entities to be processed
Throws:
ResourceInitializationException - if an error occurs during initialization

process

public void process(CollectionReader aCollectionReader,
                    int aBatchSize)
             throws ResourceInitializationException
Description copied from interface: CollectionProcessingManager
Initiates processing of a collection. This method works in the same way as CollectionProcessingManager.process(CollectionReader), but it breaks the processing up into batches of a size determined by the aBatchSize parameter. Each CasConsumer will be notified at the end of each batch.

Specified by:
process in interface CollectionProcessingManager
Parameters:
aCollectionReader - the CollectionReader from which to obtain the Entities to be processed
aBatchSize - the size of the batch.
Throws:
ResourceInitializationException - if an error occurs during initialization


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