Package javax.jms

Examples of javax.jms.QueueConnectionFactory


      {

         context = new InitialContext();

      }
      QueueConnectionFactory queueFactory = (QueueConnectionFactory) context.lookup(QUEUE_FACTORY);
      queueConnection = queueFactory.createQueueConnection();

      TopicConnectionFactory topicFactory = (TopicConnectionFactory) context.lookup(TOPIC_FACTORY);
      topicConnection = topicFactory.createTopicConnection();

      getLog().debug("Connection to spyderMQ established.");
View Full Code Here


      if( context == null )
      {
         context = new InitialContext();
      }

      QueueConnectionFactory queueFactory = (QueueConnectionFactory) context.lookup(QUEUE_FACTORY);
      queueConnection = queueFactory.createQueueConnection();

      getLog().debug("Connection to JBossMQ established.");
   }
View Full Code Here

      if (context == null)
      {
         context = getInitialContext();
      }

      QueueConnectionFactory queueFactory = (QueueConnectionFactory) context.lookup(QUEUE_FACTORY);
      queueConnection = queueFactory.createQueueConnection();
      getLog().debug("connected");

      queueConnection.start();
      session = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
      getLog().debug("session established");
View Full Code Here

       super.setUp() ;
      
       JMSDestinationsUtil.setupBasicDestinations();

      context = new InitialContext();
      QueueConnectionFactory queueFactory = (QueueConnectionFactory) context.lookup(QUEUE_FACTORY);
      queueConnection = queueFactory.createQueueConnection();
      queueConnection.start();
      session = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
      Queue queue = (Queue) context.lookup(TEST_QUEUE);
      sender = session.createSender(queue);
      receiver = session.createReceiver(queue);
View Full Code Here

      QueueConnection cnn = null;
      QueueSender sender = null;
      QueueSession session = null;

      Queue queue = (Queue) getInitialContext().lookup("queue/mdbsessionpoolclearQueue");
      QueueConnectionFactory factory = getQueueConnectionFactory();
      cnn = factory.createQueueConnection();
      session = cnn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);

      TextMessage msg = session.createTextMessage("Hello World " + new Date());

      sender = session.createSender(queue);
      sender.send(msg);
      session.close();
      cnn.close();
     
      Thread.sleep(5 * 1000);
     
      assertEquals(1, status.queueFired());
     
      MBeanServerConnection server = getServer();
     
      ObjectName provider = null;
      ObjectName providerQuery = new ObjectName("jboss.j2ee:service=EJB,*");
      Iterator mbeans = server.queryMBeans(providerQuery, null).iterator();
      while (provider == null)
      {
         ObjectInstance providerInstance = (ObjectInstance)mbeans.next();
         String name = providerInstance.getObjectName().toString();
         if (name.contains("Mdb") && !name.contains("plugin"))
            provider = providerInstance.getObjectName();
      }
     
      Object[] params = {};
      String[] sig = {};
      Object success = server.invoke(provider, "stop", params, sig);
     
      ObjectName jmsContainerInvokerQuery = new ObjectName("jboss.j2ee:binding=my-message-driven-bean,*");
      Set mbeansSet = server.queryMBeans(jmsContainerInvokerQuery, null);
      assertEquals(1, mbeansSet.size());
      ObjectInstance jmsContainerInvokerInstance = (ObjectInstance)mbeansSet.iterator().next();
      ObjectName jmsContainerInvoker = jmsContainerInvokerInstance.getObjectName();
      //      int numActiveSessions = (Integer)server.getAttribute(jmsContainerInvoker, "NumActiveSessions");
      //      assertEquals(1, numActiveSessions);
      /*boolean forceClear = (Boolean)server.getAttribute(jmsContainerInvoker, "ForceClearOnShutdown");
      assertFalse(forceClear);
      int forceClearAttempts = (Integer)server.getAttribute(jmsContainerInvoker, "ForceClearAttempts");
      assertEquals(5, forceClearAttempts);
      long forceClearOnShutdownInterval = (Long)server.getAttribute(jmsContainerInvoker, "ForceClearOnShutdownInterval");
      assertEquals(30000, forceClearOnShutdownInterval); */
     
      Thread.sleep(2 * 1000);
     
      success = server.invoke(provider, "start", params, sig);

      Thread.sleep(60 * 1000);
     
      //      numActiveSessions = (Integer)server.getAttribute(jmsContainerInvoker, "NumActiveSessions");
      //      assertEquals(1, numActiveSessions);
     
      cnn = factory.createQueueConnection();
      session = cnn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);

      msg = session.createTextMessage("Hello World " + new Date());

      sender = session.createSender(queue);
View Full Code Here

       getLog().debug("JMSPerfStresTestCase - setUp") ;

       context = getInitialContext();
     }

     QueueConnectionFactory queueFactory = (QueueConnectionFactory)context.lookup(QUEUE_FACTORY);
     queueConnection = queueFactory.createQueueConnection();

     TopicConnectionFactory topicFactory = (TopicConnectionFactory)context.lookup(TOPIC_FACTORY);
     topicConnection = topicFactory.createTopicConnection();

     getLog().debug("Connection to JMS provider established.");
View Full Code Here

      JMSDestinationsUtil.setupBasicDestinations();
     
      getLog().debug("START TEST " + getName());
      context = getInitialContext();

      QueueConnectionFactory queueFactory = (QueueConnectionFactory) context.lookup(QUEUE_FACTORY);
      queueConnection = queueFactory.createQueueConnection();

      TopicConnectionFactory topicFactory = (TopicConnectionFactory) context.lookup(TOPIC_FACTORY);
      topicConnection = topicFactory.createTopicConnection();
      topicDurableConnection = topicFactory.createTopicConnection("john", "needle");
      topicDurableConnection.setClientID("someClient");
View Full Code Here

    * @param context        Description of Parameter
    * @exception Exception  Description of Exception
    */
   protected void init(final Context context) throws Exception
   {
      QueueConnectionFactory factory =
            (QueueConnectionFactory)context.lookup(QUEUE_FACTORY);

      connection = factory.createQueueConnection();

      session = ((QueueConnection)connection).createQueueSession(false, Session.AUTO_ACKNOWLEDGE);

      Queue queue = (Queue)context.lookup(QUEUE);

View Full Code Here

    * @exception Exception
    *               Description of Exception
    */
   protected void init(final Context context) throws Exception
   {
      QueueConnectionFactory factory = (QueueConnectionFactory) context.lookup(QUEUE_FACTORY);

      connection = factory.createQueueConnection();

      session = ((QueueConnection) connection).createQueueSession(false, Session.AUTO_ACKNOWLEDGE);

      Queue queue = (Queue) context.lookup(QUEUE);

View Full Code Here

         c++;
      }
      assertTrue("Should have received all data unacked", c == iterationCount);

      queueConnection.close();
      QueueConnectionFactory queueFactory = (QueueConnectionFactory)context.lookup(QUEUE_FACTORY);
      queueConnection = queueFactory.createQueueConnection();

      assertTrue("Queue should be full", drainQueue() == iterationCount);

   }
View Full Code Here

TOP

Related Classes of javax.jms.QueueConnectionFactory

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.