psdi.iface.jms

Class JMSConsumer

    • Constructor Summary

      Constructors 
      Constructor and Description
      JMSConsumer(java.lang.String destinationName, java.lang.String selector, javax.jms.Session session, java.util.Properties env) 
      JMSConsumer(java.lang.String destinationName, java.lang.String selector, javax.jms.Session session, java.lang.String subscriptionName, java.util.Properties env) 
      JMSConsumer(java.lang.String destinationName, java.lang.String conFactoryName, java.lang.String selector, int txMode, int receiveMode, long waitTimeOut, java.util.Properties env) 
      JMSConsumer(java.lang.String destinationName, java.lang.String conFactoryName, java.lang.String selector, int txMode, int receiveMode, long waitTimeOut, java.util.Properties env, java.lang.String providerUserName, java.lang.String providerPassword) 
      JMSConsumer(java.lang.String destinationName, java.lang.String conFactoryName, java.lang.String selector, int txMode, java.util.Properties env) 
      JMSConsumer(java.lang.String destinationName, java.lang.String conFactoryName, java.lang.String selector, int txMode, java.util.Properties env, java.lang.String providerUserName, java.lang.String providerPassword) 
      JMSConsumer(java.lang.String destinationName, java.lang.String conFactoryName, java.lang.String selector, int txMode, java.lang.String subscriptionName, java.util.Properties env) 
      JMSConsumer(java.lang.String destinationName, java.lang.String conFactoryName, java.lang.String selector, int txMode, java.lang.String subscriptionName, java.util.Properties env, java.lang.String providerUserName, java.lang.String providerPassword) 
    • Field Detail

      • consumer

        protected javax.jms.MessageConsumer consumer
        The MessageConsumer used to receive messages synchronously from the Destination.
      • selector

        protected java.lang.String selector
        The message selector for the MessageConsumer.
      • subscriptionName

        protected java.lang.String subscriptionName
        The subscription name in case of subscribing to a Topic.
      • RECEIVEMODE_NOWAIT

        public static final int RECEIVEMODE_NOWAIT
        The receive mode type where the consumer will not wait for a message to come and will return immediately if it does not find any message.
        See Also:
        Constant Field Values
      • RECEIVEMODE_WAIT

        public static final int RECEIVEMODE_WAIT
        The receive mode type where the consumer will wait for a message to come till it times out.
        See Also:
        Constant Field Values
      • receiveMode

        protected int receiveMode
        The default receive mode is RECEIVEMODE_NOWAIT.
      • waitTimeOut

        protected long waitTimeOut
        The wait timeout in case the receive mode is RECEIVEMODE_WAIT.
    • Constructor Detail

      • JMSConsumer

        public JMSConsumer(java.lang.String destinationName,
                           java.lang.String conFactoryName,
                           java.lang.String selector,
                           int txMode,
                           java.util.Properties env)
                    throws MXException
        Parameters:
        destinationName - the JNDI name of the Destination.
        conFactoryName - the JNDI name of the ConnectionFactory.
        selector - The message selector for the MessageConsumer.
        txMode - The transaction mode for the JMS client Session.
        env - The env properties to create an InitialContext.
        Throws:
        MXException
      • JMSConsumer

        public JMSConsumer(java.lang.String destinationName,
                           java.lang.String conFactoryName,
                           java.lang.String selector,
                           int txMode,
                           java.util.Properties env,
                           java.lang.String providerUserName,
                           java.lang.String providerPassword)
                    throws MXException
        Parameters:
        destinationName - the JNDI name of the Destination.
        conFactoryName - the JNDI name of the ConnectionFactory.
        selector - The message selector for the MessageConsumer.
        txMode - The transaction mode for the JMS client Session.
        env - The env properties to create an InitialContext.
        providerUserName - The provider connection user.
        providerPassword - The provider connection password.
        Throws:
        MXException
      • JMSConsumer

        public JMSConsumer(java.lang.String destinationName,
                           java.lang.String conFactoryName,
                           java.lang.String selector,
                           int txMode,
                           int receiveMode,
                           long waitTimeOut,
                           java.util.Properties env)
                    throws MXException
        Parameters:
        destinationName - the JNDI name of the Destination.
        conFactoryName - the JNDI name of the ConnectionFactory.
        selector - The message selector for the MessageConsumer.
        txMode - The transaction mode for the JMS client Session.
        receiveMode - The default receive mode is RECEIVEMODE_NOWAIT.
        waitTimeOut - The wait timeout in milliseconds.
        env - The env properties to create an InitialContext.
        Throws:
        MXException
      • JMSConsumer

        public JMSConsumer(java.lang.String destinationName,
                           java.lang.String conFactoryName,
                           java.lang.String selector,
                           int txMode,
                           int receiveMode,
                           long waitTimeOut,
                           java.util.Properties env,
                           java.lang.String providerUserName,
                           java.lang.String providerPassword)
                    throws MXException
        Parameters:
        destinationName - the JNDI name of the Destination.
        conFactoryName - the JNDI name of the ConnectionFactory.
        selector - The message selector for the MessageConsumer.
        txMode - The transaction mode for the JMS client Session.
        receiveMode - The default receive mode is RECEIVEMODE_NOWAIT.
        waitTimeOut - The wait timeout in milliseconds.
        env - The env properties to create an InitialContext.
        providerUserName - The provider connection user.
        providerPassword - The provider connection password.
        Throws:
        MXException
      • JMSConsumer

        public JMSConsumer(java.lang.String destinationName,
                           java.lang.String conFactoryName,
                           java.lang.String selector,
                           int txMode,
                           java.lang.String subscriptionName,
                           java.util.Properties env,
                           java.lang.String providerUserName,
                           java.lang.String providerPassword)
                    throws MXException
        Parameters:
        destinationName - the JNDI name of the Destination.
        conFactoryName - the JNDI name of the ConnectionFactory.
        selector - The message selector for the MessageConsumer.
        txMode - The transaction mode for the JMS client Session.
        subscriptionName - The subscription name in case of subscribing to a Topic.
        env - The env properties to create an InitialContext.
        providerUserName - The provider connection user.
        providerPassword - The provider connection password.
        Throws:
        MXException
      • JMSConsumer

        public JMSConsumer(java.lang.String destinationName,
                           java.lang.String conFactoryName,
                           java.lang.String selector,
                           int txMode,
                           java.lang.String subscriptionName,
                           java.util.Properties env)
                    throws MXException
        Parameters:
        destinationName - the JNDI name of the Destination.
        conFactoryName - the JNDI name of the ConnectionFactory.
        selector - The message selector for the MessageConsumer.
        txMode - The transaction mode for the JMS client Session.
        subscriptionName - The subscription name in case of subscribing to a Topic.
        env - The env properties to create an InitialContext.
        Throws:
        MXException
      • JMSConsumer

        public JMSConsumer(java.lang.String destinationName,
                           java.lang.String selector,
                           javax.jms.Session session,
                           java.util.Properties env)
                    throws MXException
        Parameters:
        destinationName - the JNDI name of the Destination.
        selector - The message selector for the MessageConsumer.
        session - the JMS session from which the client should be created.
        env - The env properties to create an InitialContext.
        Throws:
        MXException
      • JMSConsumer

        public JMSConsumer(java.lang.String destinationName,
                           java.lang.String selector,
                           javax.jms.Session session,
                           java.lang.String subscriptionName,
                           java.util.Properties env)
                    throws MXException
        Parameters:
        destinationName - the JNDI name of the Destination.
        selector - The message selector for the MessageConsumer.
        session - the JMS session from which the client should be created.
        subscriptionName - The subscription name in case of subscribing to a Topic.
        env - The env properties to create an InitialContext.
        Throws:
        MXException
    • Method Detail

      • createClient

        protected void createClient()
                             throws MXException
        Description copied from class: JMSClient
        Internal method to create the MessageConsumer from the JMS Session.
        Throws:
        MXException
      • getMessage

        public JMSData getMessage(boolean autocommit)
                           throws MXException
        Get a message from the Queue matching the selection criterion [if a message selector is specified].
        Parameters:
        autocommit - If set to true will commit the transaction if invoked in the context of a JMS Session transaction. See txMode for more details.
        Returns:
        JMSData the JMS message.
        Throws:
        MXException
      • close

        public void close()
        Description copied from class: JMSClient
        Releses all resources that is cached by the client like JMS Session and Connection. If the Session is owned by another client then this operation will not close that Session (and Connection). Calling this method on the originating client (which created the Session and Connection) will close these resources.
        Overrides:
        close in class JMSClient
      • getJMSMessage

        protected javax.jms.Message getJMSMessage(boolean autocommit)
                                           throws MXException
        internal method to get the JMS message from the Destination.
        Parameters:
        autocommit - If set to true will commit the transaction if invoked in the context of a JMS Session transaction.
        Returns:
        the JMS message.
        Throws:
        MXException
      • createClientInSession

        public JMSClient createClientInSession()
                                        throws MXException
        Description copied from class: JMSClient
        Creates another JMSClient of the same type in this clients Session. This is used for making the this client and the newly created client to work off the same Session and hence be in the same JMS transaction context.
        Specified by:
        createClientInSession in class JMSClient
        Returns:
        the newly created JMSClient instance.
        Throws:
        MXException
      • createClientInSession

        public JMSClient createClientInSession(java.lang.String destinationName,
                                               java.util.Properties env)
                                        throws MXException
        Description copied from class: JMSClient
        Creates another JMSClient of the same type in this clients Session. This is used for making the this client and the newly created client to work off the same Session and hence be in the same JMS transaction context.
        Specified by:
        createClientInSession in class JMSClient
        Returns:
        the newly created JMSClient instance.
        Throws:
        MXException
      • createJMSProducerInSession

        public JMSProducer createJMSProducerInSession()
                                               throws MXException
        Creates a JMSProducer in the same Session.
        Returns:
        JMSProducer which shares the same Session as this jms cosumer.
        Throws:
        MXException