Package org.apache.uima.collection.impl
Class CollectionProcessingEngine_impl
- java.lang.Object
-
- org.apache.uima.collection.impl.CollectionProcessingEngine_impl
-
- All Implemented Interfaces:
CollectionProcessingEngine
public class CollectionProcessingEngine_impl extends java.lang.Object implements CollectionProcessingEngine
-
-
Constructor Summary
Constructors Constructor Description CollectionProcessingEngine_impl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addStatusCallbackListener(StatusCallbackListener aListener)
Registers a listener to receive status callbacks.void
asynchStop()
CasProcessor[]
getCasProcessors()
Gets theCasProcessors
s in this CPE, in the order in which they will be executed.BaseCollectionReader
getCollectionReader()
Gets the Collection Reader for this CPE.protected BaseCPMImpl
getCPM()
ProcessTrace
getPerformanceReport()
Gets a performance report for the processing that is currently occurring or has just completed.Progress[]
getProgress()
Gets a progress report for the processing that is currently occurring or has just completed.void
initialize(CpeDescription aCpeDescription, java.util.Map aAdditionalParams)
Initializes this CPE from acpeDescription
Applications do not need to call this method.boolean
isPaused()
Determines whether this CPE's processing is currently paused.boolean
isProcessing()
Determines whether this CPE is currently processing.void
kill()
Kill CPM hard.void
pause()
Pauses processing.void
process()
Initiates processing of a collection.void
removeStatusCallbackListener(StatusCallbackListener aListener)
Unregisters a status callback listener.void
resume()
Resumes processing that has been paused.void
stop()
Stops processing.
-
-
-
Method Detail
-
initialize
public void initialize(CpeDescription aCpeDescription, java.util.Map aAdditionalParams) throws ResourceInitializationException
Description copied from interface:CollectionProcessingEngine
Initializes this CPE from acpeDescription
Applications do not need to call this method. It is called automatically by the framework and cannot be called a second time.- Specified by:
initialize
in interfaceCollectionProcessingEngine
- Parameters:
aCpeDescription
- CPE description, generally parsed from an XML fileaAdditionalParams
- a Map containing additional parameters. May benull
if there are no parameters. Each class that implements this interface can decide what additional parameters it supports.- Throws:
ResourceInitializationException
- if a failure occurs during initialization.
-
addStatusCallbackListener
public void addStatusCallbackListener(StatusCallbackListener aListener)
Description copied from interface:CollectionProcessingEngine
Registers a listener to receive status callbacks.- Specified by:
addStatusCallbackListener
in interfaceCollectionProcessingEngine
- Parameters:
aListener
- the listener to add
-
removeStatusCallbackListener
public void removeStatusCallbackListener(StatusCallbackListener aListener)
Description copied from interface:CollectionProcessingEngine
Unregisters a status callback listener.- Specified by:
removeStatusCallbackListener
in interfaceCollectionProcessingEngine
- Parameters:
aListener
- the listener to remove
-
process
public void process() throws ResourceInitializationException
Description copied from interface:CollectionProcessingEngine
Initiates processing of a collection. This method starts the processing in another thread and returns immediately. Status of the processing can be obtained by registering a listener with theCollectionProcessingEngine.addStatusCallbackListener(StatusCallbackListener)
method.A CPE 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 CPE is free to begin another processing request, call theCollectionProcessingEngine.isProcessing()
method.- Specified by:
process
in interfaceCollectionProcessingEngine
- Throws:
ResourceInitializationException
- if an error occurs during initialization
-
isProcessing
public boolean isProcessing()
Description copied from interface:CollectionProcessingEngine
Determines whether this CPE is currently processing. This means that a processing request has been submitted and has not yet completed or beenCollectionProcessingEngine.stop()
ped. If processing is paused, this method will still returntrue
.- Specified by:
isProcessing
in interfaceCollectionProcessingEngine
- Returns:
- true if and only if this CPE is currently processing.
-
pause
public void pause()
Description copied from interface:CollectionProcessingEngine
Pauses processing. Processing can later be resumed by calling theCollectionProcessingEngine.resume()
method.- Specified by:
pause
in interfaceCollectionProcessingEngine
-
isPaused
public boolean isPaused()
Description copied from interface:CollectionProcessingEngine
Determines whether this CPE's processing is currently paused.- Specified by:
isPaused
in interfaceCollectionProcessingEngine
- Returns:
- true if and only if this CPE's processing is currently paused.
-
resume
public void resume()
Description copied from interface:CollectionProcessingEngine
Resumes processing that has been paused.- Specified by:
resume
in interfaceCollectionProcessingEngine
-
stop
public void stop()
Description copied from interface:CollectionProcessingEngine
Stops processing.- Specified by:
stop
in interfaceCollectionProcessingEngine
-
kill
public void kill()
Description copied from interface:CollectionProcessingEngine
Kill CPM hard.- Specified by:
kill
in interfaceCollectionProcessingEngine
-
asynchStop
public void asynchStop()
-
getPerformanceReport
public ProcessTrace getPerformanceReport()
Description copied from interface:CollectionProcessingEngine
Gets a performance report for the processing that is currently occurring or has just completed.- Specified by:
getPerformanceReport
in interfaceCollectionProcessingEngine
- Returns:
- an object containing performance statistics
-
getProgress
public Progress[] getProgress()
Description copied from interface:CollectionProcessingEngine
Gets a progress report for the processing that is currently occurring or has just completed.- Specified by:
getProgress
in interfaceCollectionProcessingEngine
- Returns:
- an array of
Progress
objects, each of which represents the progress in a different set of units (for example number of entities or bytes)
-
getCPM
protected BaseCPMImpl getCPM()
-
getCasProcessors
public CasProcessor[] getCasProcessors()
Description copied from interface:CollectionProcessingEngine
Gets theCasProcessors
s in this CPE, in the order in which they will be executed.- Specified by:
getCasProcessors
in interfaceCollectionProcessingEngine
- Returns:
- an array of
CasProcessor
s
-
getCollectionReader
public BaseCollectionReader getCollectionReader()
Description copied from interface:CollectionProcessingEngine
Gets the Collection Reader for this CPE.- Specified by:
getCollectionReader
in interfaceCollectionProcessingEngine
- Returns:
- the collection reader
-
-