psdi.iface.jms

Class JMSQueueBrowser



  • public class JMSQueueBrowser
    extends JMSClient
    This class is used for browsing the Queue.
    • Constructor Detail

      • JMSQueueBrowser

        public JMSQueueBrowser(java.lang.String destinationName,
                               java.lang.String conFactoryName,
                               java.lang.String selector,
                               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.
        env - The env properties to create an InitialContext.
        Throws:
        MXException
      • JMSQueueBrowser

        public JMSQueueBrowser(java.lang.String destinationName,
                               java.lang.String conFactoryName,
                               java.lang.String selector,
                               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.
        env - The env properties to create an InitialContext.
        providerUserName - The provider connection user.
        providerPassword - The provider connection password.
        Throws:
        MXException
      • JMSQueueBrowser

        public JMSQueueBrowser(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
    • 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
      • 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
      • waitTillMessageInQueue

        public void waitTillMessageInQueue(long sleepFrequency)
        This call blocks for MAX_ITERATIONS*sleepFrequency for the message in the Queue.
        Parameters:
        sleepFrequency - the check frequesncy in millis.
      • isMessageInQueue

        public boolean isMessageInQueue()
        Returns:
        true if the message is in the Queue and false otherwise.
      • getAllMessages

        public java.util.List getAllMessages()
        Returns:
        List of all the messages that match the selction criterion as per the selector.
      • getMessages

        public java.util.List getMessages(int n)
      • 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