|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.uima.collection.impl.cpm.engine.NonThreadedProcessingUnit
public class NonThreadedProcessingUnit
Field Summary | |
---|---|
protected java.lang.Object[] |
artifact
|
protected CAS[] |
casList
|
protected CPECasPool |
casPool
|
protected CAS |
conversionCas
|
protected CAS[] |
conversionCasArray
|
protected CpeConfiguration |
cpeConfiguration
|
protected CPMEngine |
cpm
|
protected CasConverter |
mConverter
|
protected boolean |
notifyListeners
|
protected long |
numToProcess
|
protected BoundedWorkQueue |
outputQueue
|
protected java.util.LinkedList |
processContainers
|
protected ProcessTrace |
processingUnitProcessTrace
|
protected boolean |
relaseCAS
|
protected java.util.ArrayList |
statusCbL
|
protected java.lang.String |
threadId
|
int |
threadState
|
protected UimaTimer |
timer
|
protected BoundedWorkQueue |
workQueue
|
Constructor Summary | |
---|---|
NonThreadedProcessingUnit(CPMEngine acpm)
|
|
NonThreadedProcessingUnit(CPMEngine acpm,
BoundedWorkQueue aInputQueue,
BoundedWorkQueue aOutputQueue)
Initialize the PU |
Method Summary | |
---|---|
void |
addStatusCallbackListener(BaseStatusCallbackListener aListener)
Plugs in Listener object used for notifications. |
protected boolean |
analyze(java.lang.Object[] aCasObjectList,
ProcessTrace pTrTemp)
|
void |
cleanup()
Null out fields of this object. |
void |
disableCasProcessor(int aCasProcessorIndex)
Disable a CASProcessor in the processing pipeline. |
void |
disableCasProcessor(java.lang.String aCasProcessorName)
Alternative method to disable Cas Processor. |
protected void |
doNotifyListeners(java.lang.Object aCas,
boolean isCasObject,
EntityProcessStatus aEntityProcStatus)
Notifies all configured listeners. |
void |
enableCasProcessor(java.lang.String aCasProcessorName)
Enables Cas Processor with a given name. |
protected long |
getBytes(java.lang.Object aCas)
Returns the size of the CAS object. |
java.util.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(java.lang.Object aCas,
boolean isCasObject,
EntityProcessStatus aEntityProcStatus)
Notifies Listeners of the fact that the pipeline has finished processing the current set Cas'es |
void |
removeStatusCallbackListener(BaseStatusCallbackListener aListener)
Removes given listener from the list of listeners |
void |
setCasPool(CPECasPool aPool)
|
void |
setContainers(java.util.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(ProcessTrace aProcessingUnitProcessTrace)
Plugs in ProcessTrace object used to collect statistics |
void |
setReleaseCASFlag(boolean aFlag)
|
void |
setUimaTimer(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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public int threadState
protected CPECasPool casPool
protected boolean relaseCAS
protected CPMEngine cpm
protected BoundedWorkQueue workQueue
protected BoundedWorkQueue outputQueue
protected CasConverter mConverter
protected ProcessTrace processingUnitProcessTrace
protected java.util.LinkedList processContainers
protected long numToProcess
protected CAS[] casList
protected java.util.ArrayList statusCbL
protected boolean notifyListeners
protected CAS conversionCas
protected java.lang.Object[] artifact
protected CAS[] conversionCasArray
protected UimaTimer timer
protected java.lang.String threadId
protected CpeConfiguration cpeConfiguration
Constructor Detail |
---|
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)
Method Detail |
---|
public 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(BaseStatusCallbackListener aListener)
aListener
- -
BaseStatusCallbackListener
instancepublic java.util.ArrayList getCallbackListeners()
BaseStatusCallbackListener
instancespublic void removeStatusCallbackListener(BaseStatusCallbackListener aListener)
aListener
- -
object to remove from the listpublic void setProcessingUnitProcessTrace(ProcessTrace aProcessingUnitProcessTrace)
aProcessingUnitProcessTrace
- -
object to compile statspublic void setUimaTimer(UimaTimer aTimer)
aTimer
- -
custom timer to usepublic void setContainers(java.util.LinkedList processorList)
aProcessor
- 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(java.lang.String aCasProcessorName)
aCasProcessorName
- -
a name of the Cas Processor to disablepublic void enableCasProcessor(java.lang.String aCasProcessorName)
aCasProcessorName
- -
name of the Cas Processor to enableprotected boolean analyze(java.lang.Object[] aCasObjectList, ProcessTrace pTrTemp) throws java.lang.Exception
java.lang.Exception
public void setReleaseCASFlag(boolean aFlag)
aFlag
- public void setCasPool(CPECasPool aPool)
tcasPool
- protected boolean isProcessorReady(int aStatus)
protected void notifyListeners(java.lang.Object aCas, boolean isCasObject, 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(java.lang.Object aCas, boolean isCasObject, EntityProcessStatus aEntityProcStatus)
aCas
- -
Cas to pass to listenerisCasObject
- -
true is Cas is of type CASaEntityProcStatus
- -
status object containing exceptions and trace infoprotected long getBytes(java.lang.Object aCas)
aCas
- -
Cas to get the size for
public void stopCasProcessors(boolean kill)
kill
- -
true if CPE has been stopped before finishing processing during external stop
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |