org.apache.uima.collection.impl.cpm.container
Class NetworkCasProcessorImpl

java.lang.Object
  extended by org.apache.uima.collection.impl.cpm.container.NetworkCasProcessorImpl
All Implemented Interfaces:
CasDataProcessor, CasProcessor

public class NetworkCasProcessorImpl
extends java.lang.Object
implements CasDataProcessor

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
NetworkCasProcessorImpl(CpeCasProcessor aCasProcessorType)
          Initializes this instance with configuration defined in the CPE descriptor.
 
Method Summary
 void batchProcessComplete(ProcessTrace aTrace)
          Notifies Network AE that end-of-batch marker has been reached.
 void collectionProcessComplete(ProcessTrace aTrace)
          This method gets called when the CPM completes processing the collection.
 ProcessingResourceMetaData getProcessingResourceMetaData()
          Returns Remote AE metadata.
 VinciTAP getProxy()
          Returns proxy to the remote AE service
 boolean isReadOnly()
          Gets whether this is a read-only CAS Processor, which does not modify the CAS.
 boolean isStateless()
          Gets whether this is a stateless CAS Processor.
 CasData process(CasData aCas)
          Main method used during analysis.
 CasData[] process(CasData[] aCasList)
          Main method used during analysis.
 void setProxy(VinciTAP aTap)
          Associates a proxy to remote annotator service.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NetworkCasProcessorImpl

public NetworkCasProcessorImpl(CpeCasProcessor aCasProcessorType)
Initializes this instance with configuration defined in the CPE descriptor.

Parameters:
aCasProcessorType -
Method Detail

setProxy

public void setProxy(VinciTAP aTap)
Associates a proxy to remote annotator service.

Parameters:
aTap - - proxy to remote service

getProxy

public VinciTAP getProxy()
Returns proxy to the remote AE service

Returns:
- proxy to remote service

process

public CasData process(CasData aCas)
                throws ResourceProcessException
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 interface CasDataProcessor
Parameters:
CasData - aCas - instance of CasData to analyze
Returns:
CasData - instance containing result of the analysis
Throws:
ResourceProcessException - if processing fails

process

public CasData[] process(CasData[] aCasList)
                  throws ResourceProcessException
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 interface CasDataProcessor
Parameters:
CasData[] - aCas - 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 interface CasProcessor
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 interface CasProcessor
Returns:
true if this CAS processor does not modify the CAS, false if it does.

getProcessingResourceMetaData

public ProcessingResourceMetaData getProcessingResourceMetaData()
Returns Remote AE metadata. This method returns the metadata associated with the annotator.

Specified by:
getProcessingResourceMetaData in interface CasProcessor
Returns:
an object containing all metadata for this CasProcessor

batchProcessComplete

public void batchProcessComplete(ProcessTrace aTrace)
                          throws ResourceProcessException,
                                 java.io.IOException
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 element.

Specified by:
batchProcessComplete in interface CasProcessor
Parameters:
aTrace - an object that records information, such as timing, about this method's execution.
Throws:
ResourceProcessException - if an exception occurs during processing
java.io.IOException - if an I/O failure occurs
See Also:
CasProcessor.batchProcessComplete(org.apache.uima.util.ProcessTrace)

collectionProcessComplete

public void collectionProcessComplete(ProcessTrace aTrace)
                               throws ResourceProcessException,
                                      java.io.IOException
This method gets called when the CPM completes processing the collection. Depending on the type of deploymnet this routine may issue a shutdown command to the service.

Specified by:
collectionProcessComplete in interface CasProcessor
Parameters:
aTrace - an object that records information, such as timing, about this method's execution.
Throws:
ResourceProcessException - if an exception occurs during processing
java.io.IOException - if an I/O failure occurs
See Also:
CasProcessor.collectionProcessComplete(org.apache.uima.util.ProcessTrace)


Copyright © 2011. All Rights Reserved.