Class JmsOutputChannel

    • Constructor Detail

      • JmsOutputChannel

        public JmsOutputChannel()
    • Method Detail

      • setServerURI

        public void setServerURI​(java.lang.String aServerURI)
        Sets the ActiveMQ Broker URI
        Specified by:
        setServerURI in interface OutputChannel
      • setFreeCasQueue

        protected void setFreeCasQueue​(javax.jms.Destination destination)
      • getServerURI

        public java.lang.String getServerURI()
      • getName

        public java.lang.String getName()
        Specified by:
        getName in interface Channel
      • setConnectionFactory

        public void setConnectionFactory​(org.apache.activemq.ActiveMQConnectionFactory connectionFactory)
        Parameters:
        connectionFactory -
      • setServiceInputEndpoint

        public void setServiceInputEndpoint​(java.lang.String anEnpoint)
      • setSecondaryInputQueue

        public void setSecondaryInputQueue​(java.lang.String anEndpoint)
      • getConnectionFactory

        public org.apache.activemq.ActiveMQConnectionFactory getConnectionFactory()
      • serializeCAS

        public java.lang.String serializeCAS​(boolean isReply,
                                             org.apache.uima.cas.CAS aCAS,
                                             java.lang.String aCasReferenceId,
                                             java.lang.String aSerializerKey)
                                      throws java.lang.Exception
        Serializes CAS using indicated Serializer.
        Parameters:
        aCAS - - CAS instance to serialize
        aSerializerKey - - a key identifying which serializer to use
        Returns:
        - String - serialized CAS as String
        Throws:
        java.lang.Exception
      • bindWithClientEndpoint

        public void bindWithClientEndpoint​(Endpoint anEndpoint)
                                    throws java.lang.Exception
        This method verifies that the destination (queue) exists. It opens a connection the a broker, creates a session and a message producer. Finally, using the message producer, sends an empty message to a queue. This API support enables checking for existence of the reply (temp) queue before any processing of a cas is done. This is an optimization to prevent expensive processing if the client destination is no longer available.
        Specified by:
        bindWithClientEndpoint in interface OutputChannel
        Throws:
        java.lang.Exception
      • sendRequest

        public void sendRequest​(int aCommand,
                                java.lang.String aCasReferenceId,
                                Endpoint anEndpoint)
                         throws AsynchAEException
        Sends request message to a delegate.
        Specified by:
        sendRequest in interface OutputChannel
        Parameters:
        aCommand - - the type of request [Process|GetMeta]
        anEndpoint - - the destination where the delegate receives messages
        Throws:
        AsynchAEException
      • sendReply

        public void sendReply​(java.lang.Throwable t,
                              java.lang.String aCasReferenceId,
                              java.lang.String aParentCasReferenceId,
                              Endpoint anEndpoint,
                              int aCommand)
                       throws AsynchAEException
        Sends JMS Reply Message to a given endpoint. The reply message contains given Throwable (with full stack)
        Specified by:
        sendReply in interface OutputChannel
        Parameters:
        t - - Throwable to include in the reply message
        anEndpoint - - an endpoint to receive the reply message
        aCasReferenceId - - a unique CAS reference id
        Throws:
        AsynchAEException
      • sendReply

        public void sendReply​(org.apache.uima.resource.metadata.ProcessingResourceMetaData aProcessingResourceMetadata,
                              Endpoint anEndpoint,
                              boolean serialize)
                       throws AsynchAEException
        Specified by:
        sendReply in interface OutputChannel
        Parameters:
        aProcessingResourceMetadata -
        anEndpoint -
        serialize -
        Throws:
        AsynchAEException
      • getControllerInputEndpoint

        public java.lang.String getControllerInputEndpoint()
      • setControllerInputEndpoint

        public void setControllerInputEndpoint​(java.lang.String controllerInputEndpoint)
      • stop

        public void stop​(int channelsToClose)
        Specified by:
        stop in interface Channel