Package org.jboss.jms.tx.ClientTransaction

Examples of org.jboss.jms.tx.ClientTransaction.SessionTxState


     
      Collections.reverse(sessionStates);
     
      for (Iterator i = sessionStates.iterator(); i.hasNext();)
      {
         SessionTxState state = (SessionTxState)i.next();
        
         List acks = state.getAcks();
        
         if (!acks.isEmpty())
         {
            DeliveryInfo info = (DeliveryInfo)acks.get(0);
           
View Full Code Here


      synchronized (sessions)
      {        
         for (Iterator i = txState.getSessionStates().iterator(); i.hasNext(); )
         {
            SessionTxState sessionState = (SessionTxState)i.next();

            // send the messages

            for (Iterator j = sessionState.getMsgs().iterator(); j.hasNext(); )
            {
               JBossMessage message = (JBossMessage)j.next();
               if (checkForDuplicates && firstIteration)
               {
                  firstIteration = false;
                  if (serverPeer.getPersistenceManagerInstance().
                     referenceExists(message.getMessageID()))
                  {
                     // This means the transaction was previously completed...
                     // we are done here then... no need to even check for ACKs or anything else
                     log.debug("Transaction " + tx + " was previously completed, ignoring call");
                     return;
                  }
               }
               sendMessage(message, tx, false);
            }

            // send the acks
                    
            // We need to lookup the session in a global map maintained on the server peer. We can't
            // just assume it's one of the sessions in the connection. This is because in the case
            // of a connection consumer, the message might be delivered through one connection and
            // the transaction committed/rolledback through another. ConnectionConsumers suck.
           
            ServerSessionEndpoint session =
               serverPeer.getSession(new Integer(sessionState.getSessionId()));
           
            if (session == null)
            {              
               throw new IllegalStateException("Cannot find session with id " +
                  sessionState.getSessionId());
            }

            session.acknowledgeTransactionally(sessionState.getAcks(), tx);
         }
      }
     
      if (trace) { log.trace(this + " processed transaction " + tx); }
   }  
View Full Code Here

     
      Collections.reverse(sessionStates);
     
      for (Iterator i = sessionStates.iterator(); i.hasNext();)
      {
         SessionTxState state = (SessionTxState)i.next();
        
         List acks = state.getAcks();
        
         if (!acks.isEmpty())
         {
            DeliveryInfo info = (DeliveryInfo)acks.get(0);
           
View Full Code Here

   {
      if (trace) { log.trace(this + " processing transaction " + tx); }

      for (Iterator i = txState.getSessionStates().iterator(); i.hasNext(); )
      {
         SessionTxState sessionState = (SessionTxState)i.next();

         // send the messages

         for (Iterator j = sessionState.getMsgs().iterator(); j.hasNext(); )
         {
            JBossMessage message = (JBossMessage)j.next();

            if (checkForDuplicates && !message.isReliable())
            {
               //Ignore np messages on failover
            }
            else
            {
               boolean accepted = sendMessage(message, tx, checkForDuplicates);

               if (!accepted)
               {
                  break;
               }
            }
         }

         // send the acks

         // We need to lookup the session in a global map maintained on the server peer. We can't
         // just assume it's one of the sessions in the connection. This is because in the case
         // of a connection consumer, the message might be delivered through one connection and
         // the transaction committed/rolledback through another. ConnectionConsumers suck.

         ServerSessionEndpoint session = serverPeer.getSession(sessionState.getSessionId());

         if (session == null)
         {
            throw new IllegalStateException("Cannot find session with id " +
               sessionState.getSessionId());
         }

         session.acknowledgeTransactionally(sessionState.getAcks(), tx);
      }

      if (trace) { log.trace(this + " processed transaction " + tx); }
   }
View Full Code Here

     
      Collections.reverse(sessionStates);
     
      for (Iterator i = sessionStates.iterator(); i.hasNext();)
      {
         SessionTxState state = (SessionTxState)i.next();
        
         List acks = state.getAcks();
        
         if (!acks.isEmpty())
         {
            DeliveryInfo info = (DeliveryInfo)acks.get(0);
           
View Full Code Here

   {
      if (trace) { log.trace(this + " processing transaction " + tx); }

      for (Iterator i = txState.getSessionStates().iterator(); i.hasNext(); )
      {
         SessionTxState sessionState = (SessionTxState)i.next();

         // send the messages

         for (Iterator j = sessionState.getMsgs().iterator(); j.hasNext(); )
         {
            JBossMessage message = (JBossMessage)j.next();

            if (checkForDuplicates && !message.isReliable())
            {
               //Ignore np messages on failover
            }
            else
            {
               boolean accepted = sendMessage(message, tx, checkForDuplicates);

               if (!accepted)
               {
                  break;
               }
            }
         }

         // send the acks

         // We need to lookup the session in a global map maintained on the server peer. We can't
         // just assume it's one of the sessions in the connection. This is because in the case
         // of a connection consumer, the message might be delivered through one connection and
         // the transaction committed/rolledback through another. ConnectionConsumers suck.

         ServerSessionEndpoint session = serverPeer.getSession(sessionState.getSessionId());

         if (session == null)
         {
            throw new IllegalStateException("Cannot find session with id " +
               sessionState.getSessionId());
         }

         session.acknowledgeTransactionally(sessionState.getAcks(), tx);
      }

      if (trace) { log.trace(this + " processed transaction " + tx); }
   }
View Full Code Here

     
      Collections.reverse(sessionStates);
     
      for (Iterator i = sessionStates.iterator(); i.hasNext();)
      {
         SessionTxState state = (SessionTxState)i.next();
        
         List acks = state.getAcks();
        
         if (!acks.isEmpty())
         {
            DeliveryInfo info = (DeliveryInfo)acks.get(0);
           
View Full Code Here

     
      Collections.reverse(sessionStates);
     
      for (Iterator i = sessionStates.iterator(); i.hasNext();)
      {
         SessionTxState state = (SessionTxState)i.next();
        
         List acks = state.getAcks();
        
         if (!acks.isEmpty())
         {
            DeliveryInfo info = (DeliveryInfo)acks.get(0);
           
View Full Code Here

   {
      if (trace) { log.trace(this + " processing transaction " + tx); }

      for (Iterator i = txState.getSessionStates().iterator(); i.hasNext(); )
      {
         SessionTxState sessionState = (SessionTxState)i.next();

         // send the messages

         for (Iterator j = sessionState.getMsgs().iterator(); j.hasNext(); )
         {
            JBossMessage message = (JBossMessage)j.next();

            if (checkForDuplicates && !message.isReliable())
            {
               //Ignore np messages on failover
            }
            else
            {
               boolean accepted = sendMessage(message, tx, checkForDuplicates);

               if (!accepted)
               {
                  break;
               }
            }
         }

         // send the acks

         // We need to lookup the session in a global map maintained on the server peer. We can't
         // just assume it's one of the sessions in the connection. This is because in the case
         // of a connection consumer, the message might be delivered through one connection and
         // the transaction committed/rolledback through another. ConnectionConsumers suck.

         ServerSessionEndpoint session = serverPeer.getSession(sessionState.getSessionId());

         if (session == null)
         {
            throw new IllegalStateException("Cannot find session with id " +
               sessionState.getSessionId());
         }

         session.acknowledgeTransactionally(sessionState.getAcks(), tx);
      }

      if (trace) { log.trace(this + " processed transaction " + tx); }
   }
View Full Code Here

     
      Collections.reverse(sessionStates);
     
      for (Iterator i = sessionStates.iterator(); i.hasNext();)
      {
         SessionTxState state = (SessionTxState)i.next();
        
         List acks = state.getAcks();
        
         if (!acks.isEmpty())
         {
            DeliveryInfo info = (DeliveryInfo)acks.get(0);
           
View Full Code Here

TOP

Related Classes of org.jboss.jms.tx.ClientTransaction.SessionTxState

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.