Class NetworkCasProcessorImpl

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

public class NetworkCasProcessorImpl extends 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 Details

    • NetworkCasProcessorImpl

      public NetworkCasProcessorImpl(CpeCasProcessor aCasProcessorType)
      Initializes this instance with configuration defined in the CPE descriptor.
      Parameters:
      aCasProcessorType - -
  • Method Details

    • 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:
      aCas - - instance of CasData to analyze
      Returns:
      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:
      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 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, 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 <checkpoint> 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
      IOException - 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 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
      IOException - if an I/O failure occurs
      See Also: