psdi.iface.jms

Class JMSQueueConsumer



  • public class JMSQueueConsumer
    extends JMSConsumer
    This class implements the functionality specific to a Queue consumer.
    • Constructor Detail

      • JMSQueueConsumer

        public JMSQueueConsumer(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
      • JMSQueueConsumer

        public JMSQueueConsumer(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
      • JMSQueueConsumer

        public JMSQueueConsumer(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
      • JMSQueueConsumer

        public JMSQueueConsumer(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
      • JMSQueueConsumer

        public JMSQueueConsumer(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
    • Method Detail

      • deleteMessage

        public java.util.Map deleteMessage()
                                    throws MXException
        Deletes the first message that metaches the selection criterion from the Queue.
        Returns:
        The deleted message properties.
        Throws:
        MXException
      • deleteMessage

        public java.lang.String deleteMessage(boolean autocommit)
                                       throws MXException
        Deletes the first message that metaches the selection criterion from the Queue.
        Parameters:
        autocommit - if set to true will commit the JMS session transaction if a transacted session is on.
        Returns:
        The messageid JMSData.MESSAGE_UNIQUEID of the deleted message.
        Throws:
        MXException
      • deleteAllMessages

        public int deleteAllMessages()
                              throws MXException
        Delete all messages from the Queue which matches the selction criterion. This method commits the transaction after each delete.
        Returns:
        The count of messages deleted.
        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.
        Overrides:
        createClientInSession in class JMSConsumer
        Returns:
        the newly created JMSClient instance.
        Throws:
        MXException