public class CPMImpl extends BaseCPMImpl implements CollectionProcessingManager
cpmThreadGroup
DOCUMENT_TEXT_FEATURE, DOCUMENT_TEXT_TYPE
Constructor and Description |
---|
CPMImpl() |
CPMImpl(ResourceManager aResourceManager) |
Modifier and Type | Method and Description |
---|---|
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
CasConsumers s 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. |
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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getPerformanceReport, getProgress, isPaused, isPauseOnException, isProcessing, isSerialProcessingRequired, pause, resume, resume, setPauseOnException, setSerialProcessingRequired, stop
public CPMImpl(ResourceManager aResourceManager) throws Exception
Exception
public AnalysisEngine getAnalysisEngine()
CollectionProcessingManager
AnalysisEngine
that is assigned to this CPM.getAnalysisEngine
in interface CollectionProcessingManager
AnalysisEngine
that this CPM will use to analyze each CAS in the
collection.public void setAnalysisEngine(AnalysisEngine aAnalysisEngine) throws ResourceConfigurationException
CollectionProcessingManager
AnalysisEngine
that is assigned to this CPM.setAnalysisEngine
in interface CollectionProcessingManager
aAnalysisEngine
- the AnalysisEngine
that this CPM will use to analyze each CAS in the
collection.ResourceConfigurationException
- if this CPM is currently processingpublic CasConsumer[] getCasConsumers()
CollectionProcessingManager
CasConsumers
s assigned to this CPM.getCasConsumers
in interface CollectionProcessingManager
CasConsumer
spublic void addCasConsumer(CasConsumer aCasConsumer) throws ResourceConfigurationException
CollectionProcessingManager
CasConsumer
to this CPM.addCasConsumer
in interface CollectionProcessingManager
aCasConsumer
- a CasConsumer
to addResourceConfigurationException
- if this CPM is currently processingpublic void removeCasConsumer(CasConsumer aCasConsumer)
CollectionProcessingManager
CasConsumer
from this CPM.removeCasConsumer
in interface CollectionProcessingManager
aCasConsumer
- the CasConsumer
to removepublic void addStatusCallbackListener(StatusCallbackListener aListener)
CollectionProcessingManager
addStatusCallbackListener
in interface CollectionProcessingManager
aListener
- the listener to addpublic void removeStatusCallbackListener(StatusCallbackListener aListener)
CollectionProcessingManager
removeStatusCallbackListener
in interface CollectionProcessingManager
aListener
- the listener to removepublic void process(CollectionReader aCollectionReader) throws ResourceInitializationException
CollectionProcessingManager
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.
process
in interface CollectionProcessingManager
aCollectionReader
- the CollectionReader
from which to obtain the Entities to be processedResourceInitializationException
- if an error occurs during initializationpublic void process(CollectionReader aCollectionReader, int aBatchSize) throws ResourceInitializationException
CollectionProcessingManager
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.process
in interface CollectionProcessingManager
aCollectionReader
- the CollectionReader
from which to obtain the Entities to be processedaBatchSize
- the size of the batch.ResourceInitializationException
- if an error occurs during initializationCopyright © 2006–2016 The Apache Software Foundation. All rights reserved.