|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface BaseCPM
The Base CPM interface is a lower-level interface to the Collection Processing Manager. It is
recommended that developers use the CollectionProcessingEngine
and CpeDescription
interfaces instead.
The CPM is configured with a list of CasProcessor
s by calling its
addCasProcessor(CasProcessor)
method. A single BaseCollectionReader
must be
provided, via the setCollectionReader(BaseCollectionReader)
method. Collection
processing is then initiated by calling the process()
method.
Listeners can register with the CPM by calling the
addStatusCallbackListener(BaseStatusCallbackListener)
method. These listeners receive
status callbacks during the processing. At any time, performance and progress reports are
available from the getPerformanceReport()
and getProgress()
methods.
A CPM implementation may choose to implement parallelization of the processing, but this is not a requirement of the architecture.
Note that a CPM only supports processing one collection at a time. Attempting to reconfigure a
CPM or start a new processing job while a previous processing job is occurring will result in a
UIMA_IllegalStateException
. Processing multiple collections
simultaneously is done by instantiating and configuring multiple instances of the CPM.
Field Summary | |
---|---|
static String |
DOCUMENT_TEXT_FEATURE
Only used for alternate CasData forms of the CAS (not used in this UIMA SDK release). |
static String |
DOCUMENT_TEXT_TYPE
Only used for alternate CasData forms of the CAS (not used in this UIMA SDK release). |
Method Summary | |
---|---|
void |
addCasProcessor(CasProcessor aCasProcessor)
Adds a CasProcessor to this CPM's list of consumers. |
void |
addCasProcessor(CasProcessor aCasProcessor,
int aIndex)
Adds a CasProcessor to this CPM's list of consumers. |
void |
addStatusCallbackListener(BaseStatusCallbackListener aListener)
Registers a listsner to receive status callbacks. |
void |
disableCasProcessor(String aCasProcessorName)
Disables a CasProcessor in this CPM's list of CasProcessors. |
CasProcessor[] |
getCasProcessors()
Gets the CasProcessors s assigned to this CPM, in the order in which they will
be caleld by the CPM. |
BaseCollectionReader |
getCollectionReader()
Gets the Collection Reader for this CPM. |
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. |
boolean |
isPaused()
Determines whether this CPM's processing is currently paused. |
boolean |
isPauseOnException()
Gets whether this CPM will automatically pause processing if an exception occurs. |
boolean |
isProcessing()
Determines whether this CPM is currently processing. |
boolean |
isSerialProcessingRequired()
Gets whether this CPM is required to process the collection's elements serially (as opposed to perfoming parallelization). |
void |
pause()
Pauses processing. |
void |
process()
Initiates processing of a collection. |
void |
removeCasProcessor(CasProcessor aCasProcessor)
Removes a CasProcessor to this CPM's list of consumers. |
void |
removeStatusCallbackListener(BaseStatusCallbackListener aListener)
Unregisters a status callback listener. |
void |
resume()
Resumes processing that has been paused. |
void |
resume(boolean aRetryFailed)
Resumes processing that has been paused. |
void |
setCollectionReader(BaseCollectionReader aCollectionReader)
Sets the Collection Reader for this CPM. |
void |
setPauseOnException(boolean aPause)
Sets whether this CPM will automatically pause processing if an exception occurs. |
void |
setSerialProcessingRequired(boolean aRequired)
Sets whether this CPM is required to process the collection's elements serially (as opposed to perfoming parallelization). |
void |
stop()
Stops processing. |
Field Detail |
---|
static final String DOCUMENT_TEXT_TYPE
static final String DOCUMENT_TEXT_FEATURE
Method Detail |
---|
BaseCollectionReader getCollectionReader()
void setCollectionReader(BaseCollectionReader aCollectionReader)
aCollectionReader
- the collection readerCasProcessor[] getCasProcessors()
CasProcessors
s assigned to this CPM, in the order in which they will
be caleld by the CPM.
CasProcessor
svoid addCasProcessor(CasProcessor aCasProcessor) throws ResourceConfigurationException
CasProcessor
to this CPM's list of consumers. The new CasProcessor will
be added to the end of the list of CAS Processors.
aCasProcessor
- a CasProcessor
to add
UIMA_IllegalStateException
- if this CPM is currently processing
ResourceConfigurationException
void addCasProcessor(CasProcessor aCasProcessor, int aIndex) throws ResourceConfigurationException
CasProcessor
to this CPM's list of consumers. The new CasProcessor will
be added at the specified index.
aCasProcessor
- the CasProcessor to addaIndex
- the index at which to add the CasProcessor
UIMA_IllegalStateException
- if this CPM is currently processing
IndexOutOfBoundsException
- if aIndex is out of range
ResourceConfigurationException
void removeCasProcessor(CasProcessor aCasProcessor)
CasProcessor
to this CPM's list of consumers.
aCasProcessor
- the CasProcessor
to remove
UIMA_IllegalStateException
- if this CPM is currently processingvoid disableCasProcessor(String aCasProcessorName)
CasProcessor
in this CPM's list of CasProcessors.
aCasProcessorName
- the name of the CasProcessor
to disable
UIMA_IllegalStateException
- if this CPM is currently processing
IOException
- if an I/O failure occursboolean isSerialProcessingRequired()
false
does not guarantee that
parallelization is performed; this is left up to the CPM implementation.
void setSerialProcessingRequired(boolean aRequired)
false
.
Note that a value of false
does not guarantee that parallelization is performed;
this is left up to the CPM implementation.
aRequired
- true if and only if serial processing is required
UIMA_IllegalStateException
- if this CPM is currently processingboolean isPauseOnException()
resume(boolean)
method.
void setPauseOnException(boolean aPause)
resume(boolean)
method.
aPause
- true if and only if this CPM should pause on exception
UIMA_IllegalStateException
- if this CPM is currently processingvoid addStatusCallbackListener(BaseStatusCallbackListener aListener)
aListener
- the listener to addvoid removeStatusCallbackListener(BaseStatusCallbackListener aListener)
aListener
- the listener to removevoid process() throws ResourceInitializationException
addStatusCallbackListener(BaseStatusCallbackListener)
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
isProcessing()
method.
ResourceInitializationException
- if an error occurs during initialization
UIMA_IllegalStateException
- if this CPM is currently processingboolean isProcessing()
stop()
ped. If processing is paused,
this method will still return true.
- Returns:
- true if and only if this CPM is currently processing.
void pause()
resume(boolean)
method.
UIMA_IllegalStateException
- if no processing is currently occuringboolean isPaused()
void resume(boolean aRetryFailed)
aRetryFailed
- if processing was paused because an exception occurred (see
setPauseOnException(boolean)
), setting a value of true
for
this parameter will cause the failed entity to be retried. A value of
false
(the default) will cause processing to continue with the next
entity after the failure.
UIMA_IllegalStateException
- if processing is not currently pausedvoid resume()
UIMA_IllegalStateException
- if processing is not currently pausedvoid stop()
UIMA_IllegalStateException
- if no processing is currently occuringProcessTrace getPerformanceReport()
Progress[] getProgress()
Progress
objects, each of which represents the progress in a
different set of units (for example number of entities or bytes)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |