Package javax.jms

Examples of javax.jms.Queue


      // we don't want to mess with JNDI, read the connection factory and the queue from their
      // serialized format, from disk
      ObjectInputStream ois =
         new ObjectInputStream(new FileInputStream(serializedFileName));
      ConnectionFactory cf =(ConnectionFactory)ois.readObject();
      Queue queue = (Queue)ois.readObject();

      ois.close();

      Connection conn = cf.createConnection();
      Session sess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
View Full Code Here


   /**
    * The simplest possible queue test.
    */
   public void testQueue() throws Exception
   {
      Queue queue = (Queue)ic.lookup("/queue/TestQueue");

      Connection conn = cf.createConnection();

      try
      {
View Full Code Here

   }

   // added for http://jira.jboss.org/jira/browse/JBMESSAGING-899
   public void testClosedConsumerAfterStart() throws Exception
   {
      Queue queue = (Queue)ic.lookup("/queue/TestQueue");

      // Maybe we could remove this counter after we are sure this test is fixed!
      // I had to use a counter because this can work in some iterations.
      for (int counter = 0; counter < 20; counter++)
      {
View Full Code Here

   /**
    * The simplest possible queue test.
    */
   public void testRedeployQueue() throws Exception
   {
      Queue queue = (Queue)ic.lookup("/queue/TestQueue");

      Connection conn = cf.createConnection();

      try
      {
View Full Code Here

   }


   public void testQueueName() throws Exception
   {
      Queue queue = (Queue)ic.lookup("/queue/TestQueue");
      assertEquals("TestQueue", queue.getQueueName());
   }
View Full Code Here

         suspended = TransactionManagerLocator.getInstance().locate().suspend();

         // send a message to the queue, using a JCA wrapper

         Queue queue = (Queue)initialContext.lookup("queue/MyQueue");

         ConnectionFactory mcf =
            (ConnectionFactory)initialContext.lookup("java:/JCAConnectionFactory");

         Connection conn = mcf.createConnection();
View Full Code Here

         ServerManagement.deployQueue("MyQueue2");

         // send a message to the queue

         ConnectionFactory cf = (ConnectionFactory)initialContext.lookup("/ConnectionFactory");
         Queue queue = (Queue)initialContext.lookup("queue/MyQueue2");
         Connection conn = cf.createConnection();
         Session s = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
         MessageProducer p = s.createProducer(queue);
         p.setDeliveryMode(DeliveryMode.PERSISTENT);
         Message m = s.createTextMessage("one");
View Full Code Here

   // Public --------------------------------------------------------

   public void testBrowser() throws Exception
   {
      ConnectionFactory cf = (ConnectionFactory)ic.lookup("/ConnectionFactory");
      Queue queue = (Queue)ic.lookup("/queue/MiscellaneousQueue");

      Connection conn = cf.createConnection();
      Session session = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
      MessageProducer prod = session.createProducer(queue);
View Full Code Here

    * Test case for http://jira.jboss.org/jira/browse/JBMESSAGING-542
    */
   public void testClosingConsumerFromMessageListener() throws Exception
   {
      ConnectionFactory cf = (ConnectionFactory)ic.lookup("/ConnectionFactory");
      Queue queue = (Queue)ic.lookup("/queue/MiscellaneousQueue");

      // load the queue

      Connection c = cf.createConnection();
      Session s = c.createSession(false, Session.AUTO_ACKNOWLEDGE);
View Full Code Here

    * Test case for http://jira.jboss.org/jira/browse/JBMESSAGING-542
    */
   public void testClosingSessionFromMessageListener() throws Exception
   {
      ConnectionFactory cf = (ConnectionFactory)ic.lookup("/ConnectionFactory");
      Queue queue = (Queue)ic.lookup("/queue/MiscellaneousQueue");

      // load the queue

      Connection c = cf.createConnection();
      Session s = c.createSession(false, Session.AUTO_ACKNOWLEDGE);
View Full Code Here

TOP

Related Classes of javax.jms.Queue

Copyright © 2018 www.massapicom. 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.