Package javax.jms

Examples of javax.jms.QueueConnectionFactory.createQueueConnection()


      {
         InitialContext iniCtx = new InitialContext();
         Integer i = (Integer) iniCtx.lookup("java:comp/env/maxActiveCount");
         maxActiveCount = i.intValue();
         QueueConnectionFactory factory = (QueueConnectionFactory) iniCtx.lookup("java:/ConnectionFactory");
         queConn = factory.createQueueConnection();
         session = queConn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
         Queue queue = (Queue) iniCtx.lookup("queue/B");
         sender = session.createSender(queue);
      }
      catch(Exception e)
View Full Code Here


   public void testPooling() throws Exception
   {
      CountDown done = new CountDown(MAX_SIZE);
      InitialContext ctx = new InitialContext();
      QueueConnectionFactory factory = (QueueConnectionFactory) ctx.lookup(QUEUE_FACTORY);
      QueueConnection queConn = factory.createQueueConnection();
      Queue queueA = (Queue) ctx.lookup("queue/A");
      Queue queueB = (Queue) ctx.lookup("queue/B");
      queConn.start();
      MDBInvoker[] threads = new MDBInvoker[MAX_SIZE];
      for(int n = 0; n < MAX_SIZE; n ++)
View Full Code Here

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

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

   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

      QueueSender sender = null;
      QueueReceiver receiver = null;

      try
      {
         queConn = factory.createQueueConnection();
         queConn.start();

         Queue queueA = (Queue) ctx.lookup("queue/A");
         Queue queueB = (Queue) ctx.lookup("queue/B");
        
View Full Code Here

      QueueSender sender = null;
      QueueReceiver receiver = null;

      try
      {
         queConn = factory.createQueueConnection();
         queConn.start();

         Queue queueA = (Queue) ctx.lookup("queue/C");
         Queue queueB = (Queue) ctx.lookup("queue/D");
View Full Code Here

      // Get the ConnectionFactory from JNDI
      final QueueConnectionFactory factory = (QueueConnectionFactory) NAMING_CONTEXT
            .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 TextMessage message = sendSession.createTextMessage(contents);
View Full Code Here

            if (USE_SECURITY_PROPERTIES){
                principal = getPrincipal(context);
                credentials = getCredentials(context);
            }
            if (principal != null && credentials != null) {
                connection = factory.createQueueConnection(principal, credentials);
            } else {
                connection = factory.createQueueConnection();
            }

            session = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
View Full Code Here

                credentials = getCredentials(context);
            }
            if (principal != null && credentials != null) {
                connection = factory.createQueueConnection(principal, credentials);
            } else {
                connection = factory.createQueueConnection();
            }

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

            if (LOGGER.isDebugEnabled()) {
View Full Code Here

                QueueBrowser qBrowser = null;
                try {
                    qConFactory = (QueueConnectionFactory) kernel.invoke(
                            ObjectName.getInstance(CONNECTION_FACTORY_NAME),
                            "$getResource");
                    qConnection = qConFactory.createQueueConnection();
                    qSession = qConnection.createQueueSession(false,
                            QueueSession.AUTO_ACKNOWLEDGE);
                    qBrowser = qSession.createBrowser(queue);
                    qConnection.start();
                    for (Enumeration e = qBrowser.getEnumeration(); e
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.