Package javax.jms

Examples of javax.jms.XAConnectionFactory


      if(!ServerManagement.isServerPeerStarted())
      {
         ServerManagement.startServerPeer();
      }
     
      XAConnectionFactory cf = (XAConnectionFactory)initialContext.lookup("/ConnectionFactory");
     
      ServerManagement.deployQueue("Queue");

      Queue queue = (Queue)initialContext.lookup("/queue/Queue");
     
      XAConnection conn = null;
     
      try
      {
         conn = cf.createXAConnection();
        
         Xid xid1, xid2;
        
         {
        
View Full Code Here


      Boolean isSupport = (Boolean)ServerManagement.getAttribute(ServerManagement.getServerPeerObjectName(),
                                                       "SupportsTxAge");

      assertTrue("Server should support Tx Age. ", isSupport);

      XAConnectionFactory cf = (XAConnectionFactory)initialContext.lookup("/ConnectionFactory");
     
      ServerManagement.deployQueue("Queue");

      Queue queue = (Queue)initialContext.lookup("/queue/Queue");
     
      XAConnection conn = null;
     
      try
      {
         conn = cf.createXAConnection();
        
         Xid xid1, xid2;
        
         {
        
View Full Code Here

      if(!ServerManagement.isServerPeerStarted())
      {
         ServerManagement.startServerPeer();
      }
     
      XAConnectionFactory cf = (XAConnectionFactory)initialContext.lookup("/ConnectionFactory");
     
      ServerManagement.deployQueue("Queue");

      Queue queue = (Queue)initialContext.lookup("/queue/Queue");
     
      XAConnection conn = null;
     
      try
      {
         conn = cf.createXAConnection();
        
         Xid xid1, xid2;
        
         {
        
View Full Code Here

      if(!ServerManagement.isServerPeerStarted())
      {
         ServerManagement.startServerPeer();
      }
     
      XAConnectionFactory cf = (XAConnectionFactory)initialContext.lookup("/ConnectionFactory");
     
      ServerManagement.deployQueue("Queue");

      Queue queue = (Queue)initialContext.lookup("/queue/Queue");
     
      XAConnection conn = null;
     
      try
      {
         conn = cf.createXAConnection();
        
         Xid xid1, xid2;
        
         {
        
View Full Code Here

      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");
View Full Code Here

    }

    public XAConnection
    createXAConnection() throws JMSException {
    if (_bc != null) {
        XAConnectionFactory cf = null;
        try {
            cf = _bc.getXAConnectionFactory(_jmsprop);
        } catch (Exception e) {
            JMSException jmse = new JMSException(e.getMessage(),
                JMSBridge.getJMSBridgeResources().E_EXCEPTION_CREATE_CF);
            jmse.setLinkedException(e);
            throw jmse;
        }
        return cf.createXAConnection();
    }
    return _cf.createXAConnection();
    }
View Full Code Here

    public XAConnection
    createXAConnection(String userName, String password)
                                    throws JMSException {
    if (_bc != null) {
        XAConnectionFactory cf = null;
        try {
            cf = _bc.getXAConnectionFactory(_jmsprop);
        } catch (Exception e) {
            JMSException jmse = new JMSException(e.getMessage(),
                JMSBridge.getJMSBridgeResources().E_EXCEPTION_CREATE_CF);
            jmse.setLinkedException(e);
            throw jmse;
        }
        return cf.createXAConnection(userName, password);
    }
    return _cf.createXAConnection(userName, password);
    }
View Full Code Here

                    rm.getResourceName() != null && !"".equals(rm.getResourceName());
        }

        public static boolean recover(final GenericResourceManager rm) throws IOException {
            if (isRecoverable(rm)) {
                final XAConnectionFactory connFactory = (XAConnectionFactory) rm.getConnectionFactory();

                RecoverableTransactionManager rtxManager = (RecoverableTransactionManager) rm.getTransactionManager();
                rtxManager.registerNamedXAResourceFactory(new NamedXAResourceFactory() {

                    public String getName() {
                        return rm.getResourceName();
                    }

                    public NamedXAResource getNamedXAResource() throws SystemException {
                        try {
                            final XAConnection activeConn = (XAConnection)connFactory.createXAConnection();
                            final XASession session = (XASession)activeConn.createXASession();
                            activeConn.start();
                            LOGGER.debug("new namedXAResource's connection: " + activeConn);

                            return new ConnectionAndWrapperNamedXAResource(session.getXAResource(), getName(), activeConn);
View Full Code Here

         suspended = TransactionManagerLocator.getInstance().locate().suspend();

         // send a message to the queue using an XASession that's not enlisted in a global tx

         XAConnectionFactory xcf = (XAConnectionFactory)cf;

         XAConnection xconn = xcf.createXAConnection();

         XASession xs = xconn.createXASession();
        
         MessageProducer p = xs.createProducer(queue1);
         Message m = xs.createTextMessage("one");
View Full Code Here

         Integer count = (Integer) ServerManagement.getAttribute(queueMBean, "MessageCount");
         assertEquals(1, count.intValue());

         // using XA with a ConnectionConsumer (testing the transaction behavior under MDBs)

         XAConnectionFactory xacf = (XAConnectionFactory)cf;
         xaconn = xacf.createXAConnection();
         xaconn.start();
         XASession xasession = xaconn.createXASession();
         DummyListener listener = new DummyListener();
         xasession.setMessageListener(listener);
View Full Code Here

TOP

Related Classes of javax.jms.XAConnectionFactory

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.