Package javax.jms

Examples of javax.jms.QueueConnectionFactory


            properties.put(AQInitialContextFactory.DB_PASSWD, password);
            properties.put(AQInitialContextFactory.DB_SCHEMA, schema);
            properties.put(AQInitialContextFactory.DB_DRIVER, driver);
            MockContextFactory.setAsInitial();
            Context context = new InitialContext(properties);
            QueueConnectionFactory queueConnectionFactory = (QueueConnectionFactory)
                context.lookup(AQInitialContextFactory.QUEUE_CONNECTION_FACTORY);
            connection = queueConnectionFactory.createQueueConnection();
            session = connection.createQueueSession(false,
            QueueSession.AUTO_ACKNOWLEDGE);
            Queue queue = (Queue) context.lookup(qName);
            messageProducer = session.createSender(queue);
            messageConsumer = session.createReceiver(queue);
View Full Code Here


        "org.jboss.naming:org.jnp.interfaces");
    properties1.put(Context.PROVIDER_URL, "jnp://127.0.0.1:1099");
    InitialContext iniCtx = new InitialContext(properties1);

      Object tmp = iniCtx.lookup("ConnectionFactory");
      QueueConnectionFactory qcf = (QueueConnectionFactory) tmp;
      conn = qcf.createQueueConnection();
      que = (Queue) iniCtx.lookup("queue/quickstart_helloworld_topic_notifier_Request_gw");
      session = conn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
      conn.start();
      System.out.println("Connection Started");
    }
View Full Code Here

        QueueConnection queueConnection = null;
        Session session = null;
        System.out.println("Building our own db connection");
        try {
            DataSource ds = AQUtil.getSQLDataSource(server, instance, port, driver, user, password);
            QueueConnectionFactory queueFactory = AQjmsFactory.getQueueConnectionFactory(ds);
            queueConnection = queueFactory.createQueueConnection();
            assertNotNull(queueConnection);
            session = (AQjmsSession) queueConnection.createQueueSession(false,
                    Session.AUTO_ACKNOWLEDGE);
            assertNotNull(session);
        } catch (Throwable e) {
View Full Code Here

        QueueConnection queueConnection = null;
        Session session = null;
        System.out.println("Building our own db connection");
        try {
            DataSource ds = AQUtil.getSQLDataSource(server, instance, port, driver, user, password);
            QueueConnectionFactory queueFactory = AQjmsFactory.getQueueConnectionFactory(ds);
            queueConnection = queueFactory.createQueueConnection();
            assertNotNull(queueConnection);
            session = (AQjmsSession) queueConnection.createQueueSession(false,
                    Session.AUTO_ACKNOWLEDGE);
            assertNotNull(session);
           
View Full Code Here

        "org.jboss.naming:org.jnp.interfaces");
    properties1.put(Context.PROVIDER_URL, "jnp://127.0.0.1:1099");
    InitialContext iniCtx = new InitialContext(properties1);

      Object tmp = iniCtx.lookup("ConnectionFactory");
      QueueConnectionFactory qcf = (QueueConnectionFactory) tmp;
      conn = qcf.createQueueConnection();
      que = (Queue) iniCtx.lookup("queue/quickstart_messagealerts_Request_gw");
      session = conn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
      conn.start();
      System.out.println("Connection Started");
    }
View Full Code Here

   public void setupConnection() throws JMSException, NamingException
   {
      InitialContext iniCtx = new InitialContext();
      Object tmp = iniCtx.lookup("ConnectionFactory");
      QueueConnectionFactory qcf = (QueueConnectionFactory) tmp;
      conn = qcf.createQueueConnection();
      que = (Queue) iniCtx.lookup("queue/quickstart_spring_helloworld_Request");
      session = conn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
      conn.start();
      System.out.println("Connection Started");
   }
View Full Code Here

        "org.jboss.naming:org.jnp.interfaces");
    properties1.put(Context.PROVIDER_URL, "jnp://127.0.0.1:1099");
    InitialContext iniCtx = new InitialContext(properties1);

      Object tmp = iniCtx.lookup("ConnectionFactory");
      QueueConnectionFactory qcf = (QueueConnectionFactory) tmp;
      conn = qcf.createQueueConnection();
      que = (Queue) iniCtx.lookup("queue/quickstart_webservice_consumer2_Request_gw");
      session = conn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
      conn.start();
      System.out.println("Connection Started");
    }
View Full Code Here

       
    public void setupConnection(String queueName) throws JMSException, NamingException
    {
      InitialContext iniCtx = new InitialContext();
      Object tmp = iniCtx.lookup("ConnectionFactory");
      QueueConnectionFactory qcf = (QueueConnectionFactory) tmp;
      conn = qcf.createQueueConnection();
      que = (Queue) iniCtx.lookup(queueName);
      session = conn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
      conn.start();
      System.out.println("Connection Started");
    }
View Full Code Here

                {
                    return connections.get(JMSType.QUEUE);
                }
                else
                {
                    QueueConnectionFactory ccf = (QueueConnectionFactory) createOrReturnConnectionFactory();
                    QueueConnection qc = ccf.createQueueConnection();
                    connections.put(JMSType.QUEUE, qc);

                    return qc;
                }
            }
            else if (jmsModel.getJmsType().equals(JMSType.TOPIC))
            {
                if (connections.containsKey(JMSType.TOPIC))
                {
                    return connections.get(JMSType.TOPIC);
                }
                else
                {
                    TopicConnectionFactory ccf = (TopicConnectionFactory) createOrReturnConnectionFactory();
                    TopicConnection qc = ccf.createTopicConnection();
                    connections.put(JMSType.TOPIC, qc);

                    return qc;
                }
View Full Code Here

                testJmsConnection(topicConnectionFactory.createConnection());

                obj = ejbContext.lookup("QueueCF");
                Assert.assertNotNull("The JMS QueueConnectionFactory is null", obj);
                Assert.assertTrue("Not an instance of QueueConnectionFactory", obj instanceof QueueConnectionFactory);
                QueueConnectionFactory queueConnectionFactory = (QueueConnectionFactory) obj;
                testJmsConnection(queueConnectionFactory.createConnection());
            } catch (Exception e){
                e.printStackTrace();
                Assert.fail("Received Exception "+e.getClass()+ " : "+e.getMessage());
            }
        } catch (AssertionFailedError afe){
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.