public class NonThreadedProcessingUnit extends Object
| Modifier and Type | Field and Description |
|---|---|
protected Object[] |
artifact
The artifact.
|
protected org.apache.uima.cas.CAS[] |
casList
The cas list.
|
protected CPECasPool |
casPool
The cas pool.
|
protected org.apache.uima.cas.CAS |
conversionCas
The conversion cas.
|
protected org.apache.uima.cas.CAS[] |
conversionCasArray
The conversion cas array.
|
protected org.apache.uima.collection.metadata.CpeConfiguration |
cpeConfiguration
The cpe configuration.
|
protected CPMEngine |
cpm
The cpm.
|
protected CasConverter |
mConverter
The m converter.
|
protected boolean |
notifyListeners
The notify listeners.
|
protected long |
numToProcess
The num to process.
|
protected BoundedWorkQueue |
outputQueue
The output queue.
|
protected LinkedList |
processContainers
The process containers.
|
protected org.apache.uima.util.ProcessTrace |
processingUnitProcessTrace
The processing unit process trace.
|
protected boolean |
relaseCAS
The relase CAS.
|
protected ArrayList |
statusCbL
The status cb L.
|
protected String |
threadId
The thread id.
|
int |
threadState
The thread state.
|
protected org.apache.uima.util.UimaTimer |
timer
The timer.
|
protected BoundedWorkQueue |
workQueue
The work queue.
|
| Constructor and Description |
|---|
NonThreadedProcessingUnit(CPMEngine acpm)
Instantiates a new non threaded processing unit.
|
NonThreadedProcessingUnit(CPMEngine acpm,
BoundedWorkQueue aInputQueue,
BoundedWorkQueue aOutputQueue)
Initialize the PU.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addStatusCallbackListener(org.apache.uima.collection.base_cpm.BaseStatusCallbackListener aListener)
Plugs in Listener object used for notifications.
|
protected boolean |
analyze(Object[] aCasObjectList,
org.apache.uima.util.ProcessTrace pTrTemp)
Analyze.
|
void |
cleanup()
Null out fields of this object.
|
void |
disableCasProcessor(int aCasProcessorIndex)
Disable a CASProcessor in the processing pipeline.
|
void |
disableCasProcessor(String aCasProcessorName)
Alternative method to disable Cas Processor.
|
protected void |
doNotifyListeners(Object aCas,
boolean isCasObject,
org.apache.uima.collection.EntityProcessStatus aEntityProcStatus)
Notifies all configured listeners.
|
void |
enableCasProcessor(String aCasProcessorName)
Enables Cas Processor with a given name.
|
protected long |
getBytes(Object aCas)
Returns the size of the CAS object.
|
ArrayList |
getCallbackListeners()
Returns list of listeners used by this PU for callbacks.
|
protected boolean |
isProcessorReady(int aStatus)
Check if the CASProcessor status is available for processing.
|
protected void |
notifyListeners(Object aCas,
boolean isCasObject,
org.apache.uima.collection.EntityProcessStatus aEntityProcStatus)
Notifies Listeners of the fact that the pipeline has finished processing the current set Cas'es.
|
void |
removeStatusCallbackListener(org.apache.uima.collection.base_cpm.BaseStatusCallbackListener aListener)
Removes given listener from the list of listeners.
|
void |
setCasPool(CPECasPool aPool)
Sets the cas pool.
|
void |
setContainers(LinkedList processorList)
Plugs in a list of Cas Processor containers.
|
void |
setCPMEngine(CPMEngine acpm)
Alternative method of providing the reference to the component managing the lifecycle of the
CPE.
|
void |
setInputQueue(BoundedWorkQueue aInputQueue)
Alternative method of providing a queue from which this PU will read bundle of Cas.
|
void |
setNotifyListeners(boolean aDoNotify)
Set a flag indicating if notifications should be made via configured Listeners.
|
void |
setOutputQueue(BoundedWorkQueue aOutputQueue)
Alternative method of providing a queue where this PU will deposit results of analysis.
|
void |
setProcessingUnitProcessTrace(org.apache.uima.util.ProcessTrace aProcessingUnitProcessTrace)
Plugs in ProcessTrace object used to collect statistics.
|
void |
setReleaseCASFlag(boolean aFlag)
Sets the release CAS flag.
|
void |
setUimaTimer(org.apache.uima.util.UimaTimer aTimer)
Plugs in custom timer used by the PU for getting time.
|
void |
stopCasProcessors(boolean kill)
Stops all Cas Processors that are part of this PU.
|
public int threadState
protected CPECasPool casPool
protected boolean relaseCAS
protected CPMEngine cpm
protected BoundedWorkQueue workQueue
protected BoundedWorkQueue outputQueue
protected CasConverter mConverter
protected org.apache.uima.util.ProcessTrace processingUnitProcessTrace
protected LinkedList processContainers
protected long numToProcess
protected org.apache.uima.cas.CAS[] casList
protected ArrayList statusCbL
protected boolean notifyListeners
protected org.apache.uima.cas.CAS conversionCas
protected Object[] artifact
protected org.apache.uima.cas.CAS[] conversionCasArray
protected org.apache.uima.util.UimaTimer timer
protected String threadId
protected org.apache.uima.collection.metadata.CpeConfiguration cpeConfiguration
public NonThreadedProcessingUnit(CPMEngine acpm, BoundedWorkQueue aInputQueue, BoundedWorkQueue aOutputQueue)
acpm - -
component managing life cycle of the CPEaInputQueue - -
queue to read fromaOutputQueue - -
queue to write topublic NonThreadedProcessingUnit(CPMEngine acpm)
acpm - the acpmpublic void setInputQueue(BoundedWorkQueue aInputQueue)
aInputQueue - -
read queuepublic void setOutputQueue(BoundedWorkQueue aOutputQueue)
aOutputQueue - -
queue to write topublic void setCPMEngine(CPMEngine acpm)
acpm - -
reference to the contrlling enginepublic void cleanup()
public void setNotifyListeners(boolean aDoNotify)
aDoNotify - -
true if notification is required, false otherwisepublic void addStatusCallbackListener(org.apache.uima.collection.base_cpm.BaseStatusCallbackListener aListener)
aListener - -
BaseStatusCallbackListener instancepublic ArrayList getCallbackListeners()
BaseStatusCallbackListener
instancespublic void removeStatusCallbackListener(org.apache.uima.collection.base_cpm.BaseStatusCallbackListener aListener)
aListener - -
object to remove from the listpublic void setProcessingUnitProcessTrace(org.apache.uima.util.ProcessTrace aProcessingUnitProcessTrace)
aProcessingUnitProcessTrace - -
object to compile statspublic void setUimaTimer(org.apache.uima.util.UimaTimer aTimer)
aTimer - -
custom timer to usepublic void setContainers(LinkedList processorList)
processorList - CASProcessor to be added to the processing pipelinepublic void disableCasProcessor(int aCasProcessorIndex)
aCasProcessorIndex - -
location in the pipeline of the Cas Processor to deletepublic void disableCasProcessor(String aCasProcessorName)
aCasProcessorName - -
a name of the Cas Processor to disablepublic void enableCasProcessor(String aCasProcessorName)
aCasProcessorName - -
name of the Cas Processor to enableprotected boolean analyze(Object[] aCasObjectList, org.apache.uima.util.ProcessTrace pTrTemp) throws Exception
aCasObjectList - the a cas object listpTrTemp - the tr tempException - the exceptionpublic void setReleaseCASFlag(boolean aFlag)
aFlag - the new release CAS flagpublic void setCasPool(CPECasPool aPool)
aPool - the new cas poolprotected boolean isProcessorReady(int aStatus)
aStatus - the a statusprotected void notifyListeners(Object aCas, boolean isCasObject, org.apache.uima.collection.EntityProcessStatus aEntityProcStatus)
aCas - -
object containing an array of OR a single instance of CasisCasObject - -
true if instance of Cas is of type Cas, false otherwiseaEntityProcStatus - -
status object that may contain exceptions and traceprotected void doNotifyListeners(Object aCas, boolean isCasObject, org.apache.uima.collection.EntityProcessStatus aEntityProcStatus)
aCas - -
Cas to pass to listenerisCasObject - -
true is Cas is of type CASaEntityProcStatus - -
status object containing exceptions and trace infoprotected long getBytes(Object aCas)
aCas - -
Cas to get the size forpublic void stopCasProcessors(boolean kill)
kill - -
true if CPE has been stopped before finishing processing during external stopCopyright © 2006–2017 The Apache Software Foundation. All rights reserved.