Class NetworkCasProcessorImpl
java.lang.Object
org.apache.uima.collection.impl.cpm.container.NetworkCasProcessorImpl
- All Implemented Interfaces:
CasDataProcessor
,CasProcessor
Implementation of the
CasDataProcessor
interface used for both Local and Remote
CasDataProcessors. The CPE delegates analysis of entities to this instance. Each instance of this
class has a proxy to extenal service.-
Constructor Summary
ConstructorDescriptionNetworkCasProcessorImpl
(CpeCasProcessor aCasProcessorType) Initializes this instance with configuration defined in the CPE descriptor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
batchProcessComplete
(ProcessTrace aTrace) Notifies Network AE that end-of-batch marker has been reached.void
This method gets called when the CPM completes processing the collection.Returns Remote AE metadata.getProxy()
Returns proxy to the remote AE serviceboolean
Gets whether this is a read-only CAS Processor, which does not modify the CAS.boolean
Gets whether this is a stateless CAS Processor.Main method used during analysis.CasData[]
Main method used during analysis.void
Associates a proxy to remote annotator service.
-
Constructor Details
-
NetworkCasProcessorImpl
Initializes this instance with configuration defined in the CPE descriptor.- Parameters:
aCasProcessorType
- -
-
-
Method Details
-
setProxy
Associates a proxy to remote annotator service.- Parameters:
aTap
- - proxy to remote service
-
getProxy
Returns proxy to the remote AE service- Returns:
- - proxy to remote service
-
process
Main method used during analysis. The ProcessingUnit calls this method to initiate analysis of the content in the CasData instance. This handles one Cas at a time processing mode.- Specified by:
process
in interfaceCasDataProcessor
- Parameters:
aCas
- - instance of CasData to analyze- Returns:
- instance containing result of the analysis
- Throws:
ResourceProcessException
- if processing fails
-
process
Main method used during analysis. The ProcessingUnit calls this method to initiate analysis of the content in the CasData instance. This handles processing of multiple Cas'es at a time.- Specified by:
process
in interfaceCasDataProcessor
- Parameters:
aCasList
- - array of CasData instances to analyze- Returns:
- CasData - array of CasData instances containing results of the analysis
- Throws:
ResourceProcessException
- if processing fails
-
isStateless
public boolean isStateless()Description copied from interface:CasProcessor
Gets whether this is a stateless CAS Processor. Stateless CAS Processors do not maintain any data between calls to their process methods.- Specified by:
isStateless
in interfaceCasProcessor
- Returns:
- true if this CAS processor is stateless, false if it is stateful.
-
isReadOnly
public boolean isReadOnly()Description copied from interface:CasProcessor
Gets whether this is a read-only CAS Processor, which does not modify the CAS.- Specified by:
isReadOnly
in interfaceCasProcessor
- Returns:
- true if this CAS processor does not modify the CAS, false if it does.
-
getProcessingResourceMetaData
Returns Remote AE metadata. This method returns the metadata associated with the annotator.- Specified by:
getProcessingResourceMetaData
in interfaceCasProcessor
- Returns:
- an object containing all metadata for this CasProcessor
-
batchProcessComplete
Notifies Network AE that end-of-batch marker has been reached. The notification can be disabled in the Cpe descriptor by setting batch=0 in the <checkpoint> element.- Specified by:
batchProcessComplete
in interfaceCasProcessor
- Parameters:
aTrace
- an object that records information, such as timing, about this method's execution.- Throws:
ResourceProcessException
- if an exception occurs during processingIOException
- if an I/O failure occurs- See Also:
-
collectionProcessComplete
public void collectionProcessComplete(ProcessTrace aTrace) throws ResourceProcessException, IOException This method gets called when the CPM completes processing the collection. Depending on the type of deployment this routine may issue a shutdown command to the service.- Specified by:
collectionProcessComplete
in interfaceCasProcessor
- Parameters:
aTrace
- an object that records information, such as timing, about this method's execution.- Throws:
ResourceProcessException
- if an exception occurs during processingIOException
- if an I/O failure occurs- See Also:
-