Package javax.jms

Examples of javax.jms.XAConnectionFactory


        Object preliminaryObject = lookup(ctx, connectionFactory, Object.class);
        log.debug("Got connection factory " + preliminaryObject + " from " + connectionFactory);
        log.debug("Attempting to create connection with user " + user);
        Connection result;
        if (isDeliveryTransacted) {
            XAConnectionFactory xagcf = (XAConnectionFactory) preliminaryObject;
            if (user != null) {
                result = xagcf.createXAConnection(user, pass);
            } else {
                result = xagcf.createXAConnection();
            }
        } else {
            if (preliminaryObject instanceof XAConnectionFactory) {
                XAConnectionFactory xagcf = (XAConnectionFactory) preliminaryObject;
                if (user != null) {
                    result = xagcf.createXAConnection(user, pass);
                } else {
                    result = xagcf.createXAConnection();
                }
            } else {
                ConnectionFactory gcf = (ConnectionFactory) preliminaryObject;
                if (user != null) {
                    result = gcf.createConnection(user, pass);
View Full Code Here


   public void testSimpleXAConnectionFailover() throws Exception
   {
      XAConnection conn = null;
     
      XAConnectionFactory xaCF = (XAConnectionFactory)cf;

      try
      {
         // create a connection to node 1
         conn = createXAConnectionOnServer(xaCF, 1);
View Full Code Here

   public void testSendFailBeforePrepare() throws Exception
   {
      XAConnection xaConn = null;
     
      XAConnectionFactory xaCF = (XAConnectionFactory)cf;
     
      Connection conn = null;
     
      try
      {
View Full Code Here

  
   public void testSendAndReceiveFailBeforePrepare() throws Exception
   {
      XAConnection xaConn = null;
     
      XAConnectionFactory xaCF = (XAConnectionFactory)cf;
     
      Connection conn = null;
     
      try
      {
View Full Code Here

   {
      XAConnection xaConn0 = null;
     
      XAConnection xaConn1 = null;
     
      XAConnectionFactory xaCF = (XAConnectionFactory)cf;
     
      try
      {
         xaConn0 = createXAConnectionOnServer(xaCF, 0);
        
View Full Code Here

  
   public void testSendAndReceiveFailAfterPrepareAndRetryCommit() throws Exception
   {
      XAConnection xaConn1 = null;
     
      XAConnectionFactory xaCF = (XAConnectionFactory)cf;
     
      TextMessage sent1 = null;

      // Sending a messages
      {
View Full Code Here

   {
      XAConnection xaConn0 = null;
     
      XAConnection xaConn1 = null;
     
      XAConnectionFactory xaCF = (XAConnectionFactory)cf;
     
      TextMessage sent0 = null;

      TextMessage sent1 = null;

      // Sending two messages.. on each server
      {
         Connection conn0 = null;

         Connection conn1 = null;

         conn0 = this.createConnectionOnServer(cf, 0);

         assertEquals(0, ((JBossConnection)conn0).getServerID());

         conn1 = this.createConnectionOnServer(cf, 1);

         assertEquals(1, ((JBossConnection)conn1).getServerID());

         //Send a message to each queue

         Session sess = conn0.createSession(false, Session.AUTO_ACKNOWLEDGE);

         MessageProducer prod = sess.createProducer(queue[0]);

         sent0 = sess.createTextMessage("plop0");

         prod.send(sent0);

         sess.close();

         sess = conn1.createSession(false, Session.AUTO_ACKNOWLEDGE);

         prod = sess.createProducer(queue[1]);

         sent1 = sess.createTextMessage("plop1");

         prod.send(sent1);

         sess.close();
        
         conn0.close();
        
         conn1.close();
      }

      try
      {
         xaConn0 = xaCF.createXAConnection();
        
         assertEquals(0, ((JBossConnection)xaConn0).getServerID());

         xaConn1 = xaCF.createXAConnection();
        
         assertEquals(1, ((JBossConnection)xaConn1).getServerID());

         xaConn0.start();
        
View Full Code Here

   {
      XAConnection xaConn = null;
      JBossConnection conn = null;
      JBossConnectionConsumer cc = null;
     
      XAConnectionFactory xaCF = (XAConnectionFactory)cf;

      try
      {
         conn = (JBossConnection)createConnectionOnServer(cf, 1);
         xaConn = createXAConnectionOnServer(xaCF, 1);
View Full Code Here

   public void testSimpleXAConnectionFailover() throws Exception
   {
      XAConnection conn = null;
     
      XAConnectionFactory xaCF = (XAConnectionFactory)cf;

      try
      {
         // create a connection to node 1
         conn = createXAConnectionOnServer(xaCF, 1);
View Full Code Here

   public void testSendFailBeforePrepare() throws Exception
   {
      XAConnection xaConn = null;
     
      XAConnectionFactory xaCF = (XAConnectionFactory)cf;
     
      Connection conn = null;
     
      try
      {
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.