Package javax.jms

Examples of javax.jms.Session.createBrowser()


      {
         Session ps = pconn.createSession(false, Session.AUTO_ACKNOWLEDGE);

         try
         {
            ps.createBrowser(new JBossQueue("NoSuchQueue"));
            fail("should throw exception");
         }
         catch(InvalidDestinationException e)
         {
            // OK
View Full Code Here


      Connection conn = null;
      try
      {
         conn = cf.createConnection("john", "needle");
         Session sess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
         sess.createBrowser(testQueue);
      }
      finally
      {
         if (conn != null) conn.close();
      }
View Full Code Here

      Connection conn = null;
      try
      {
         conn = cf.createConnection("nobody", "nobody");
         Session sess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
         sess.createBrowser(testQueue);
         fail("should throw JMSSecurityException");
      }
      catch (JMSSecurityException e)
      {
         //Expected
View Full Code Here

   {
      Connection conn = cf.createConnection();
      Session sess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
      MessageConsumer consumer = sess.createConsumer(topic);
      MessageProducer producer = sess.createProducer(topic);
      sess.createBrowser(queue);
      Message m = sess.createMessage();

      conn.close();

      // Session
View Full Code Here

      TextMessage m = session.createTextMessage("message one");

      prod.send(m);

      QueueBrowser browser = session.createBrowser(queue);


      Enumeration e = browser.getEnumeration();

      TextMessage bm = (TextMessage)e.nextElement();
View Full Code Here

     
      try
      {
         conn = getConnection();
         session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
         QueueBrowser browser = session.createBrowser(queue);
        
         ArrayList list = new ArrayList();
         for(Enumeration e = browser.getEnumeration(); e.hasMoreElements(); )
         {
            list.add(e.nextElement());
View Full Code Here

         assertEquals(1, ((JBossConnection)conn).getServerID());

         Session session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);

         QueueBrowser browser = session.createBrowser(queue[1]);

         Enumeration en = browser.getEnumeration();
         assertFalse(en.hasMoreElements());

         // send one persistent and one non-persistent message
View Full Code Here

         assertEquals(1, ((JBossConnection)conn).getServerID());

         Session session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);

         QueueBrowser browser = session.createBrowser(queue[1]);

         Enumeration en = browser.getEnumeration();
         assertFalse(en.hasMoreElements());

         // register a failover listener
View Full Code Here

            getDelegate()).getRemotingConnection();
         rc.removeConnectionListener();

         Session session1 = conn1.createSession(false, Session.AUTO_ACKNOWLEDGE);

         QueueBrowser browser = session1.createBrowser(queue[1]);

         ServerManagement.killAndWait(1);

         browser.close();
      }
View Full Code Here

      message.setText("Persistent message");
      sender.send(message, DeliveryMode.PERSISTENT, 4, 0);
      message.setText("High Priority Persistent message");
      sender.send(message, DeliveryMode.PERSISTENT, 9, 0);

      QueueBrowser browser = session.createBrowser(queue);
      Enumeration i = browser.getEnumeration();
      getLog().debug(message.getText());

      message = (TextMessage) i.nextElement();
      getLog().debug(message.getText());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.