Package javax.jms

Examples of javax.jms.QueueConnectionFactory


        // Build Context
        Context initialContext = getInitialContext();

        // Get factory
        QueueConnectionFactory queueConnectionFactory = (QueueConnectionFactory) initialContext
                .lookup(QUEUE_CONNECTION_FACTORY);

        // Lookup the Queue through its JNDI name
        Queue queue = (Queue) initialContext.lookup(SAMPLE_QUEUE);
        Queue queueContext = (QueueinitialContext.lookup(SAMPLE_QUEUE_CONTEXT);


        // Create connection
        QueueConnection queueConnection = queueConnectionFactory.createQueueConnection();

        // Create session
        QueueSession queueSession = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);

        // Create sender
View Full Code Here


        this.joramAdapter.createTopicCF("TCF");

        // Create connection factories  that will be used by a pure JMS Client
        ConnectionFactory jcf = null;
        TopicConnectionFactory jtcf = null;
        QueueConnectionFactory jqcf = null;

        String name = CONN_FACT_NAME;
        try {
            jcf = TcpConnectionFactory.create(this.host, this.port);
            this.ictx.rebind(name, jcf);
View Full Code Here

        // Get context
        Context initialContext = getInitialContext();

        // Get factory
        QueueConnectionFactory queueConnectionFactory = (QueueConnectionFactory) initialContext
        .lookup(QUEUE_CONNECTION_FACTORY);

        // Lookup the Queues through their JNDI name
        Queue annotationQueue = (Queue) initialContext.lookup(SAMPLE_QUEUE_MDB_ANNOTATION);
        Queue xmlQueue = (Queue) initialContext.lookup(SAMPLE_QUEUE_MDB_XML);

        // Create connection
        queueConnection = queueConnectionFactory.createQueueConnection();

        // Create session
        queueSession = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);

        // Create senders
View Full Code Here

   /**
    * com.sun.ts.tests.jms.ee.all.queueconn.QueueConnTest line 171
    */
   public void test_1() throws Exception
   {
      QueueConnectionFactory qcf = (QueueConnectionFactory)ic.lookup("/ConnectionFactory");
      Queue queue = (Queue)ic.lookup("/queue/Queue");

      QueueConnection qc =  qcf.createQueueConnection();
      QueueSession qs = qc.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);

      QueueReceiver qreceiver = qs.createReceiver(queue, "targetMessage = TRUE");

      qc.start();
View Full Code Here

   }
  
   public void testQueueConnectionConsumerWrongTemporaryDestination() throws Exception
   {
      InitialContext ctx = getInitialContext();
      QueueConnectionFactory factory = (QueueConnectionFactory) ctx.lookup("ConnectionFactory");
      Queue queue = null;
      QueueConnection connection = factory.createQueueConnection();
      try
      {
         QueueSession s = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
         queue = s.createTemporaryQueue();
         QueueConnection connection2 = factory.createQueueConnection();
         try
         {
            connection2.createConnectionConsumer(queue, "", MockServerSessionPool.getServerSessionPool(), 1);
            fail("Expected an error listening to a temporary destination from a different connection");
         }
View Full Code Here

      // Get the queue from JNDI
      final Context naimgContext = getInitialContext();
      final Queue queue = (Queue) naimgContext.lookup(TestLoggingMDB.QUEUE_NAME);

      // Get the ConnectionFactory from JNDI
      final QueueConnectionFactory factory = (QueueConnectionFactory) naimgContext.lookup(JNDI_NAME_CONNECTION_FACTORY);

      // Make a Connection
      final QueueConnection connection = factory.createQueueConnection();
      final QueueSession sendSession = connection.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);

      // Make the message
      final String contents = "Test Message Contents";
      final TextMessage message = sendSession.createTextMessage(contents);
View Full Code Here

   protected void connect() throws Exception
   {
      Context context = getInitialContext();
      queue = (Queue) context.lookup(QUEUE);
      QueueConnectionFactory queueFactory = (QueueConnectionFactory) context.lookup(QUEUE_FACTORY);
      queueConnection = queueFactory.createQueueConnection();
      queueConnection.start();

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

//      assertEquals(SimpleValueSupport.wrap(0), messageCount.getValue());

      // Send a message
      Queue queue = (Queue) getInitialContext().lookup(jndiName);
      assertNotNull(queue);
      QueueConnectionFactory qCf = (QueueConnectionFactory) getInitialContext().lookup("ConnectionFactory");
      QueueConnection c = qCf.createQueueConnection();
      c.start();
      QueueSession s = c.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
      QueueSender sender = s.createSender(queue);
     
      // Message 1
View Full Code Here

   }

   private void testJMS(Context initCtx, Context myEnv) throws NamingException
   {
      // JavaMail Session
      QueueConnectionFactory qf = (QueueConnectionFactory) myEnv.lookup("jms/QueFactory");
      log.debug("jms/QueFactory = " + qf);
   }
View Full Code Here

   }

   public void testReconnectStress() throws Throwable
   {
      InitialContext ctx = new InitialContext();
      QueueConnectionFactory qcf = (QueueConnectionFactory) ctx.lookup(QUEUE_FACTORY);
     
      ReconnectThread[] threads = new ReconnectThread[getThreadCount()];
      for (int i = 0; i < threads.length; ++i)
         threads[i] = new ReconnectThread(qcf, "Reconnect-"+i);
      for (int i = 0; i < threads.length; ++i)
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.