Class MemoryTransportSender

  • All Implemented Interfaces:
    org.apache.uima.analysis_component.AnalysisComponent

    public class MemoryTransportSender
    extends AbstractTransportConsumer
    This class provides an in memory implementation of an AbstractTransportConsumer.

    This implementation can only be used for transport within a single Baleen instance and for testing and development.

    Configuration Parameters:
    ParameterDescriptionDefault Value(s)
    topicThe topic for transport use{@link AbstractTransportCollectionReader#PARAM_TOPIC_DEFAULT}
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void closeQueue()
      Close the queue and release and resources
      protected void createQueue()
      Create the Queue for the transport of the data
      protected int getDefaultCapacity()  
      protected int getQueueLength()
      Get the current length of the queue.
      protected void writeToQueue​(java.lang.String id, java.lang.String jCas)
      Write the given data to the queue
      • Methods inherited from class uk.gov.dstl.baleen.uima.BaleenConsumer

        getAction
      • Methods inherited from class uk.gov.dstl.baleen.uima.BaleenAnnotator

        addToJCasIndex, addToJCasIndex, createMonitor, createSupport, destroy, getDocumentAnnotation, getMonitor, getSupport, initialize, mergeWithExisting, mergeWithExisting, mergeWithNew, mergeWithNew, process, removeFromJCasIndex, removeFromJCasIndex
      • Methods inherited from class org.apache.uima.analysis_component.JCasAnnotator_ImplBase

        getRequiredCasInterface, process
      • Methods inherited from class org.apache.uima.analysis_component.Annotator_ImplBase

        getCasInstancesRequired, hasNext, next
      • Methods inherited from class org.apache.uima.analysis_component.AnalysisComponent_ImplBase

        batchProcessComplete, collectionProcessComplete, getContext, getLogger, getResultSpecification, reconfigure, setResultSpecification
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MemoryTransportSender

        public MemoryTransportSender()
    • Method Detail

      • createQueue

        protected void createQueue()
                            throws uk.gov.dstl.baleen.exceptions.BaleenException
        Description copied from class: AbstractTransportConsumer
        Create the Queue for the transport of the data
        Specified by:
        createQueue in class AbstractTransportConsumer
        Throws:
        uk.gov.dstl.baleen.exceptions.BaleenException - if the queue can not be created correctly
      • closeQueue

        protected void closeQueue()
                           throws java.io.IOException
        Description copied from class: AbstractTransportConsumer
        Close the queue and release and resources
        Specified by:
        closeQueue in class AbstractTransportConsumer
        Throws:
        java.io.IOException - if the queue can not be closed correctly
      • writeToQueue

        protected void writeToQueue​(java.lang.String id,
                                    java.lang.String jCas)
                             throws java.io.IOException
        Description copied from class: AbstractTransportConsumer
        Write the given data to the queue
        Specified by:
        writeToQueue in class AbstractTransportConsumer
        Parameters:
        id - the id
        jCas - to write
        Throws:
        java.io.IOException - if writing fails
      • getQueueLength

        protected int getQueueLength()
        Description copied from class: AbstractTransportConsumer
        Get the current length of the queue. This is used, with the capacity to determine if we should backoff writing to the queue.
        Specified by:
        getQueueLength in class AbstractTransportConsumer
        Returns:
        the current length of the queue or 0 if this can not be determined.