Examples of XAQueueConnection


Examples of javax.jms.XAQueueConnection

        return proxy;
    }

    public QueueConnection createQueueConnection(String username, String password) throws JMSException
    {
        XAQueueConnection xaqc = ((XAQueueConnectionFactory) factory).createXAQueueConnection(username,
                                                                                              password);
        QueueConnection proxy = (QueueConnection) Proxy.newProxyInstance(Connection.class.getClassLoader(),
                                                                         new Class[]{QueueConnection.class, XaResourceFactoryHolder.class},
                                                                         new ConnectionInvocationHandler(xaqc, sameRMOverrideValue));
        return proxy;
View Full Code Here

Examples of javax.jms.XAQueueConnection

     * @return QueueConnection The connection.
     */

    public QueueConnection createQueueConnection () throws JMSException
    {
        XAQueueConnection xac = factory_.createXAQueueConnection ();
        return new JtaQueueConnection ( xac, res_ );
    }
View Full Code Here

Examples of javax.jms.XAQueueConnection

     */

    public QueueConnection createQueueConnection ( String user , String pw )
            throws JMSException
    {
        XAQueueConnection xac = factory_.createXAQueueConnection ( user, pw );
        return new JtaQueueConnection ( xac, res_ );
    }
View Full Code Here

Examples of javax.jms.XAQueueConnection

      resourceAdapter.start(ctx);
      HornetQRAConnectionManager qraConnectionManager = new HornetQRAConnectionManager();
      HornetQRAManagedConnectionFactory mcf = new HornetQRAManagedConnectionFactory();
      mcf.setResourceAdapter(resourceAdapter);
      HornetQRAConnectionFactory qraConnectionFactory = new HornetQRAConnectionFactoryImpl(mcf, qraConnectionManager);
      XAQueueConnection queueConnection = qraConnectionFactory.createXAQueueConnection();
      XASession s = queueConnection.createXASession();

      XAResource resource = s.getXAResource();
      resource.start(xid, XAResource.TMNOFLAGS);
      Queue q = HornetQJMSClient.createQueue(MDBQUEUE);
      MessageProducer mp = s.createProducer(q);
      MessageConsumer consumer = s.createConsumer(q);
      Message message = s.createTextMessage("test");
      mp.send(message);
      queueConnection.start();
      TextMessage textMessage = (TextMessage) consumer.receiveNoWait();
      assertNull(textMessage);
      resource.end(xid, XAResource.TMSUCCESS);
      resource.commit(xid, true);
      resource.start(xid, XAResource.TMNOFLAGS);
View Full Code Here

Examples of javax.jms.XAQueueConnection

   {
      Connection genericConnection = null;
      XAConnection xaConnection = null;
      QueueConnection queueConnection = null;
      TopicConnection topicConnection = null;
      XAQueueConnection xaQueueConnection = null;
      XATopicConnection xaTopicConnection = null;

      ConnectionFactory genericFactory = (ConnectionFactory)JMSTestCase.ic.lookup("/ConnectionFactory");
      genericConnection = genericFactory.createConnection();
      assertConnectionType(genericConnection, "generic");

      XAConnectionFactory xaFactory = (XAConnectionFactory)JMSTestCase.ic.lookup("/CF_XA_TRUE");
      xaConnection = xaFactory.createXAConnection();
      assertConnectionType(xaConnection, "xa");

      QueueConnectionFactory queueCF = (QueueConnectionFactory)JMSTestCase.ic.lookup("/CF_QUEUE");
      queueConnection = queueCF.createQueueConnection();
      assertConnectionType(queueConnection, "queue");

      TopicConnectionFactory topicCF = (TopicConnectionFactory)JMSTestCase.ic.lookup("/CF_TOPIC");
      topicConnection = topicCF.createTopicConnection();
      assertConnectionType(topicConnection, "topic");

      XAQueueConnectionFactory xaQueueCF = (XAQueueConnectionFactory)JMSTestCase.ic.lookup("/CF_QUEUE_XA_TRUE");
      xaQueueConnection = xaQueueCF.createXAQueueConnection();
      assertConnectionType(xaQueueConnection, "xa-queue");

      XATopicConnectionFactory xaTopicCF = (XATopicConnectionFactory)JMSTestCase.ic.lookup("/CF_TOPIC_XA_TRUE");
      xaTopicConnection = xaTopicCF.createXATopicConnection();
      assertConnectionType(xaTopicConnection, "xa-topic");

      genericConnection.close();
      xaConnection.close();
      queueConnection.close();
      topicConnection.close();
      xaQueueConnection.close();
      xaTopicConnection.close();
   }
View Full Code Here

Examples of javax.jms.XAQueueConnection

      resourceAdapter.start(ctx);
      HornetQRAConnectionManager qraConnectionManager = new HornetQRAConnectionManager();
      HornetQRAManagedConnectionFactory mcf = new HornetQRAManagedConnectionFactory();
      mcf.setResourceAdapter(resourceAdapter);
      HornetQRAConnectionFactory qraConnectionFactory = new HornetQRAConnectionFactoryImpl(mcf, qraConnectionManager);
      XAQueueConnection queueConnection = qraConnectionFactory.createXAQueueConnection();
      XASession s = queueConnection.createXASession();

      XAResource resource = s.getXAResource();
      resource.start(xid, XAResource.TMNOFLAGS);
      Queue q = HornetQJMSClient.createQueue(MDBQUEUE);
      MessageProducer mp = s.createProducer(q);
      MessageConsumer consumer = s.createConsumer(q);
      Message message = s.createTextMessage("test");
      mp.send(message);
      queueConnection.start();
      TextMessage textMessage = (TextMessage) consumer.receiveNoWait();
      assertNull(textMessage);
      resource.end(xid, XAResource.TMSUCCESS);
      resource.commit(xid, true);
      resource.start(xid, XAResource.TMNOFLAGS);
View Full Code Here

Examples of javax.jms.XAQueueConnection

     * @return QueueConnection The connection.
     */

    public QueueConnection createQueueConnection () throws JMSException
    {
        XAQueueConnection xac = factory_.createXAQueueConnection ();
        return new JtaQueueConnection ( xac, res_ );
    }
View Full Code Here

Examples of javax.jms.XAQueueConnection

     */

    public QueueConnection createQueueConnection ( String user , String pw )
            throws JMSException
    {
        XAQueueConnection xac = factory_.createXAQueueConnection ( user, pw );
        return new JtaQueueConnection ( xac, res_ );
    }
View Full Code Here

Examples of javax.jms.XAQueueConnection

      throw new JbpmException("couldn't send jms message to queue"+e.getMessage(), e);
    }
  }

  protected void sendToQueueXA(Queue queue, XAQueueConnectionFactory xaQueueConnectionFactory) throws Exception {
    XAQueueConnection xaQueueConnection = null;
    XAQueueSession xaQueueSession = null;
    MessageProducer messageProducer = null;

    try {
      xaQueueConnection = xaQueueConnectionFactory.createXAQueueConnection();
      xaQueueSession = xaQueueConnection.createXAQueueSession();
      messageProducer = xaQueueSession.createProducer(queue);
      Message message = createMessage(xaQueueSession);
      messageProducer.send(message);

    } finally {
      try {
        messageProducer.close();
      } catch (Exception e) {
        e.printStackTrace();
      }
      try {
        xaQueueSession.close();
      } catch (Exception e) {
        e.printStackTrace();
      }
      try {
        xaQueueConnection.close();
      } catch (Exception e) {
        e.printStackTrace();
      }
    }
  }
View Full Code Here

Examples of org.objectweb.joram.client.jms.XAQueueConnection

   * @exception IllegalStateException  If the server is not listening.
   */
 
  public javax.jms.XAQueueConnection createXAQueueConnection(String name, String password) throws javax.jms.JMSException {
    initIdentity(name, password);
    return new XAQueueConnection(params, createRequestChannel(params, identity, reliableClass));
  }
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.