Package org.jboss.jms.client.state

Examples of org.jboss.jms.client.state.ConnectionState


            {
               // the session is non-XA and transacted, or XA and enrolled in a global transaction. An
               // XA session that has not been enrolled in a global transaction behaves as a
               // transacted session.
              
               ConnectionState connState = (ConnectionState)state.getParent();
     
               if (trace) { log.trace("sending acknowlegment transactionally, queueing on resource manager"); }
     
               // If the ack is for a delivery that came through via a connection consumer then we use
               // the connectionConsumer session as the session id, otherwise we use this sessions'
               // session ID
              
               ClientSessionDelegate connectionConsumerDelegate =
                  (ClientSessionDelegate)info.getConnectionConsumerSession();
              
               String sessionId = connectionConsumerDelegate != null ?
                  connectionConsumerDelegate.getID() : state.getSessionID();
              
               if (info.getSource() != null)
               {
                  //from a normal session (non CC).
                  result = state.addAckToResourceManager(connState.getResourceManager(), txID, sessionId, info);
               }
               else
               {
                  connState.getResourceManager().addAck(txID, sessionId, info);
               }
            }       
         }
      }
     
View Full Code Here


            if (txID != null)
            {

               if (trace) { log.trace("Marking tx " + txID + " to be rollback only"); }
              
               ConnectionState connState = (ConnectionState)state.getParent();
              
               connState.getResourceManager().markTxRollbackOnly(txID);
            }       
         }
      }
     
      return null;
View Full Code Here

         if (state.isXA())
         {
            throw new TransactionInProgressException("Cannot call commit on an XA session");
         }
  
         ConnectionState connState = (ConnectionState)state.getParent();
         ConnectionDelegate conn = (ConnectionDelegate)connState.getDelegate();
    
         try
         {
            connState.getResourceManager().commitLocal((LocalTx)state.getCurrentTxId(), conn);
         }
         finally
         {
            //Start new local tx
            Object xid = connState.getResourceManager().createLocalTx();
  
            state.setCurrentTxId(xid);
         }
        
         //TODO on commit we don't want to ACK any messages that have exceeded the max delivery count OR
View Full Code Here

         if (state.isXA())
         {
            throw new TransactionInProgressException("Cannot call rollback on an XA session");
         }
        
         ConnectionState connState = (ConnectionState)state.getParent();
         ResourceManager rm = connState.getResourceManager();
         try
         {
            rm.rollbackLocal((LocalTx)state.getCurrentTxId());
         }
         finally
View Full Code Here

      {
         // the session is non-XA and transacted, or XA and enrolled in a global transaction, so
         // we add the message to a transaction instead of sending it now. An XA session that has
         // not been enrolled in a global transaction behaves as a non-transacted session.

         ConnectionState connState = (ConnectionState)state.getParent();
         MethodInvocation mi = (MethodInvocation)invocation;
         Message m = (Message)mi.getArguments()[0];

         if (trace) { log.trace("sending message " + m + " transactionally, queueing on resource manager txID=" + txID + " sessionID= " + state.getSessionID()); }

         connState.getResourceManager().addMessage(txID, state.getSessionID(), (JBossMessage)m);

         // ... and we don't invoke any further interceptors in the stack
         return null;
      }
View Full Code Here

         ConnectionFactory cf = (ConnectionFactory)ic[0].lookup("/ClusteredTestChangeRateConfigSettingsFactory");
         c = cf.createConnection();
        
         ClientConnectionDelegate del1 = (ClientConnectionDelegate)((JBossConnection)c).getDelegate();
        
         ConnectionState state1 = (ConnectionState)del1.getState();
        
         long maxRetry = state1.getMaxRetryChangeRate();
        
         assertEquals(10, maxRetry);
        
         long retryInterval = state1.getRetryChangeRateInterval();
        
         assertEquals(2345, retryInterval);
      }
      finally
      {
View Full Code Here

         ConnectionFactory cf = (ConnectionFactory)ic[0].lookup("/ClusteredTestChangeRateConfigSettingsFactory");
         c = cf.createConnection();
        
         ClientConnectionDelegate del1 = (ClientConnectionDelegate)((JBossConnection)c).getDelegate();
        
         ConnectionState state1 = (ConnectionState)del1.getState();
        
         long maxRetry = state1.getMaxRetryChangeRate();
        
         assertEquals(10, maxRetry);
        
         long retryInterval = state1.getRetryChangeRateInterval();
        
         assertEquals(2345, retryInterval);
      }
      finally
      {
View Full Code Here

         ConnectionFactory cf = (ConnectionFactory)ic[0].lookup("/ClusteredTestChangeRateConfigDefaultsFactory");
         c = cf.createConnection();
        
         ClientConnectionDelegate del1 = (ClientConnectionDelegate)((JBossConnection)c).getDelegate();
        
         ConnectionState state1 = (ConnectionState)del1.getState();
        
         long maxRetry = state1.getMaxRetryChangeRate();
        
         assertEquals(0, maxRetry);
        
         long retryInterval = state1.getRetryChangeRateInterval();
        
         assertEquals(5000, retryInterval);
      }
      finally
      {
View Full Code Here

         ConnectionFactory cf = (ConnectionFactory)ic[0].lookup("/ClusteredTestMinTimeoutProcessTimeConfigSettingsFactory");
         c = cf.createConnection();
        
         ClientConnectionDelegate del1 = (ClientConnectionDelegate)((JBossConnection)c).getDelegate();
        
         ConnectionState state1 = (ConnectionState)del1.getState();
        
         long minTime = state1.getMinTimeoutProcessTime();
        
         assertEquals(100, minTime);
      }
      finally
      {
View Full Code Here

         ConnectionFactory cf = (ConnectionFactory)ic[0].lookup("/ClusteredTestMinTimeoutProcessTimeConfigSettingsFactory");
         c = cf.createConnection();
        
         ClientConnectionDelegate del1 = (ClientConnectionDelegate)((JBossConnection)c).getDelegate();
        
         ConnectionState state1 = (ConnectionState)del1.getState();
        
         long minTime = state1.getMinTimeoutProcessTime();
        
         assertEquals(100, minTime);
      }
      finally
      {
View Full Code Here

TOP

Related Classes of org.jboss.jms.client.state.ConnectionState

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.