Package javax.jms

Examples of javax.jms.QueueConnectionFactory


   /**
    * Test creation of QueueSession
    */
   public void testQueueConnection1() throws Exception
   {
      QueueConnectionFactory qcf = (QueueConnectionFactory)cf;

      QueueConnection qc = qcf.createQueueConnection();

      qc.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);

      qc.close();
   }
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

  public void initialize(Properties props, WorkerBuildContext context, DirectoryBasedIndexManager indexManager) {
    this.indexManager = indexManager;
    this.jmsQueueName = props.getProperty( JMS_QUEUE );
    this.indexName = indexManager.getIndexName();
    this.searchFactory = context.getUninitializedSearchFactory();
    QueueConnectionFactory factory = initializeJMSQueueConnectionFactory( props );
    this.jmsQueue = initializeJMSQueue( factory, props );
    this.connection = initializeJMSConnection( factory, props );
  }
View Full Code Here

  public void initialize(Properties props, WorkerBuildContext context, DirectoryBasedIndexManager indexManager) {
    this.indexManager = indexManager;
    this.jmsQueueName = props.getProperty( JMS_QUEUE );
    this.indexName = indexManager.getIndexName();
    this.searchFactory = context.getUninitializedSearchFactory();
    QueueConnectionFactory factory = initializeJMSQueueConnectionFactory( props );
    this.jmsQueue = initializeJMSQueue( factory, props );
    this.connection = initializeJMSConnection( factory, props );
  }
View Full Code Here

   
    public void setupConnection() throws JMSException, NamingException
    {
    InitialContext iniCtx = new InitialContext();

      QueueConnectionFactory queueConnectionFactory = (QueueConnectionFactory) iniCtx.lookup("ConnectionFactory");
     
      connection = queueConnectionFactory.createQueueConnection();
     
      queue = (Queue) iniCtx.lookup("queue/quickstart_jms_transacted_Request_gw");
      session = connection.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE);
      connection.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_consumer_wise2_Request_gw");
      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_helloworld_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

            env.put(AQInitialContextFactory.DB_DRIVER, driver);
           
            MockContextFactory.setAsInitial();
            AQInitialContextFactory factory = new AQInitialContextFactory();
            Context context = factory.getInitialContext(env);
            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);
            messageConsumer = session.createReceiver(queue);
            connection.start();
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.