Class JmsInputChannel

  • All Implemented Interfaces:
    java.io.Serializable, Channel, InputChannel, JmsInputChannelMBean, org.springframework.jms.listener.SessionAwareMessageListener

    public class JmsInputChannel
    extends java.lang.Object
    implements InputChannel, JmsInputChannelMBean, org.springframework.jms.listener.SessionAwareMessageListener
    Thin adapter for receiving JMS messages from Spring. It delegates processing of all messages to the Handler. Each JMS Message is wrapped in transport neutral MessageContext wrapper.
    See Also:
    Serialized Form
    • Field Detail

      • attachToBrokerMBeanServer

        public static transient boolean attachToBrokerMBeanServer
    • Constructor Detail

      • JmsInputChannel

        public JmsInputChannel()
    • Method Detail

      • getName

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

        public void setController​(AnalysisEngineController aController)
                           throws java.lang.Exception
        Throws:
        java.lang.Exception
      • setMessageHandler

        public void setMessageHandler​(Handler aHandler)
      • setEndpointName

        public void setEndpointName​(java.lang.String anEndpointName)
      • validMessage

        public boolean validMessage​(javax.jms.Message aMessage)
                             throws java.lang.Exception
        Validates contents of the message. It checks if command, payload and message types contain valid data.
        Parameters:
        aMessage - - JMS Message to validate
        Returns:
        - true if message is valid, false otherwise
        Throws:
        java.lang.Exception
      • abort

        public void abort()
      • onMessage

        public void onMessage​(javax.jms.Message aMessage,
                              javax.jms.Session aJmsSession)
        Receives Messages from the JMS Provider. It checks the message header to determine the type of message received. Based on the type, a MessageContext is created to facilitate access to the transport specific message. Once the MessageContext is determined this routine delegates handling of the message to the chain of MessageHandlers.
        Specified by:
        onMessage in interface org.springframework.jms.listener.SessionAwareMessageListener
        Parameters:
        aMessage - - JMS Message containing header and payload
        aJmsSession - - JMSSession object
      • getConnectionFactory

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

        public void setServerUri​(java.lang.String serverUri)
        Specified by:
        setServerUri in interface InputChannel
      • stop

        public void stop()
                  throws java.lang.Exception
        Specified by:
        stop in interface Channel
        Throws:
        java.lang.Exception
      • stop

        public void stop​(int channelsToClose)
                  throws java.lang.Exception
        Specified by:
        stop in interface Channel
        Throws:
        java.lang.Exception
      • createListener

        public void createListener​(java.lang.String aDelegateKey,
                                   Endpoint endpointToUpdate)
                            throws java.lang.Exception
        Specified by:
        createListener in interface InputChannel
        Throws:
        java.lang.Exception
      • isListenerActiveOnDestination

        public boolean isListenerActiveOnDestination​(javax.jms.Destination destination)
      • destroyListener

        public void destroyListener​(java.lang.String anEndpointName,
                                    java.lang.String aDelegateKey)
        Specified by:
        destroyListener in interface InputChannel
      • isFailed

        public boolean isFailed​(java.lang.String aDelegateKey)
        Specified by:
        isFailed in interface InputChannel