Class CPMImpl
java.lang.Object
org.apache.uima.collection.impl.cpm.BaseCPMImpl
org.apache.uima.collection.impl.cpm.CPMImpl
- All Implemented Interfaces:
Runnable,BaseCPM,CollectionProcessingManager
-
Field Summary
Fields inherited from class org.apache.uima.collection.impl.cpm.BaseCPMImpl
cpmExecutorServiceFields inherited from interface org.apache.uima.collection.base_cpm.BaseCPM
DOCUMENT_TEXT_FEATURE, DOCUMENT_TEXT_TYPE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCasConsumer(CasConsumer aCasConsumer) Adds aCasConsumerto this CPM.voidaddStatusCallbackListener(StatusCallbackListener aListener) Registers a listsner to receive status callbacks.Gets theAnalysisEnginethat is assigned to this CPM.Gets theCasConsumerss assigned to this CPM.voidprocess(CollectionReader aCollectionReader) Initiates processing of a collection.voidprocess(CollectionReader aCollectionReader, int aBatchSize) Initiates processing of a collection.voidremoveCasConsumer(CasConsumer aCasConsumer) Removes aCasConsumerfrom this CPM.voidUnregisters a status callback listener.voidsetAnalysisEngine(AnalysisEngine aAnalysisEngine) Sets theAnalysisEnginethat 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, stopMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.uima.collection.CollectionProcessingManager
getPerformanceReport, getProgress, isPaused, isPauseOnException, isProcessing, isSerialProcessingRequired, pause, resume, resume, setPauseOnException, setSerialProcessingRequired, stop
-
Constructor Details
-
Method Details
-
getAnalysisEngine
Description copied from interface:CollectionProcessingManagerGets theAnalysisEnginethat is assigned to this CPM.- Specified by:
getAnalysisEnginein interfaceCollectionProcessingManager- Returns:
- the
AnalysisEnginethat this CPM will use to analyze each CAS in the collection.
-
setAnalysisEngine
Description copied from interface:CollectionProcessingManagerSets theAnalysisEnginethat is assigned to this CPM.- Specified by:
setAnalysisEnginein interfaceCollectionProcessingManager- Parameters:
aAnalysisEngine- theAnalysisEnginethat this CPM will use to analyze each CAS in the collection.- Throws:
ResourceConfigurationException- if this CPM is currently processing
-
getCasConsumers
Description copied from interface:CollectionProcessingManagerGets theCasConsumerss assigned to this CPM.- Specified by:
getCasConsumersin interfaceCollectionProcessingManager- Returns:
- an array of
CasConsumers
-
addCasConsumer
Description copied from interface:CollectionProcessingManagerAdds aCasConsumerto this CPM.- Specified by:
addCasConsumerin interfaceCollectionProcessingManager- Parameters:
aCasConsumer- aCasConsumerto add- Throws:
ResourceConfigurationException- if this CPM is currently processing
-
removeCasConsumer
Description copied from interface:CollectionProcessingManagerRemoves aCasConsumerfrom this CPM.- Specified by:
removeCasConsumerin interfaceCollectionProcessingManager- Parameters:
aCasConsumer- theCasConsumerto remove
-
addStatusCallbackListener
Description copied from interface:CollectionProcessingManagerRegisters a listsner to receive status callbacks.- Specified by:
addStatusCallbackListenerin interfaceCollectionProcessingManager- Parameters:
aListener- the listener to add
-
removeStatusCallbackListener
Description copied from interface:CollectionProcessingManagerUnregisters a status callback listener.- Specified by:
removeStatusCallbackListenerin interfaceCollectionProcessingManager- Parameters:
aListener- the listener to remove
-
process
Description copied from interface:CollectionProcessingManagerInitiates 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 theCollectionProcessingManager.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_IllegalStateExceptionwill result. To find out whether a CPM is free to begin another processing request, call theCollectionProcessingManager.isProcessing()method.- Specified by:
processin interfaceCollectionProcessingManager- Parameters:
aCollectionReader- theCollectionReaderfrom 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:CollectionProcessingManagerInitiates processing of a collection. This method works in the same way asCollectionProcessingManager.process(CollectionReader), but it breaks the processing up into batches of a size determined by theaBatchSizeparameter. EachCasConsumerwill be notified at the end of each batch.- Specified by:
processin interfaceCollectionProcessingManager- Parameters:
aCollectionReader- theCollectionReaderfrom which to obtain the Entities to be processedaBatchSize- the size of the batch.- Throws:
ResourceInitializationException- if an error occurs during initialization
-