Package org.jboss.jms.delegate

Examples of org.jboss.jms.delegate.SessionDelegate


         {
            DeliveryInfo info = (DeliveryInfo)acks.get(0);

            MessageProxy mp = info.getMessageProxy();

            SessionDelegate del = mp.getSessionDelegate();

            del.redeliver(acks);
         }
      }
   }
View Full Code Here


      if (transacted)
      {
         acknowledgeMode = Session.SESSION_TRANSACTED;
      }

      SessionDelegate sessionDelegate =
         delegate.createSessionDelegate(transacted, acknowledgeMode, isXA);
      return new JBossSession(sessionDelegate, type);
   }
View Full Code Here

      // Create the message handler
      SessionState sessionState =
         (SessionState)((DelegateSupport)invocation.getTargetObject()).getState();
      ConnectionState connectionState = (ConnectionState)sessionState.getParent();
      SessionDelegate sessionDelegate = (SessionDelegate)invocation.getTargetObject();
      ConsumerState consumerState = (ConsumerState)((DelegateSupport)consumerDelegate).getState();
      String consumerID = consumerState.getConsumerID();
      int prefetchSize = consumerState.getBufferSize();
      QueuedExecutor sessionExecutor = sessionState.getExecutor();
      int maxDeliveries = consumerState.getMaxDeliveries();
View Full Code Here

      // Create the message handler
      SessionState sessionState =
         (SessionState)((DelegateSupport)invocation.getTargetObject()).getState();
      ConnectionState connectionState = (ConnectionState)sessionState.getParent();
      SessionDelegate sessionDelegate = (SessionDelegate)invocation.getTargetObject();
      ConsumerState consumerState = (ConsumerState)((DelegateSupport)consumerDelegate).getState();
      String consumerID = consumerState.getConsumerID();
      int prefetchSize = consumerState.getBufferSize();
      QueuedExecutor sessionExecutor = sessionState.getExecutor();
      int maxDeliveries = consumerState.getMaxDeliveries();
View Full Code Here

  
   public Object handleClosing(Invocation invocation) throws Throwable
   {
      MethodInvocation mi = (MethodInvocation)invocation;
      SessionState state = getState(invocation);
      SessionDelegate del = (SessionDelegate)mi.getTargetObject();
           
      if (trace) { log.trace("handleClosing()"); }

      //Sanity check
      if (state.isXA() && !isXAAndConsideredNonTransacted(state))
View Full Code Here

      synchronized (state)
      {
        
         int ackMode = state.getAcknowledgeMode();
        
         SessionDelegate sd = (SessionDelegate)mi.getTargetObject();
        
         boolean res = true;
  
         // if XA and there is no transaction enlisted on XA we will act as AutoAcknowledge
         // However if it's a MDB (if there is a DistinguishedListener) we should behaved as transacted
View Full Code Here

      MethodInvocation mi = (MethodInvocation)invocation;
      SessionState state = getState(invocation);
     
      synchronized (state)
      {     
         SessionDelegate del = (SessionDelegate)mi.getTargetObject();           
      
         if (!state.getClientAckList().isEmpty())
         {                
            //CLIENT_ACKNOWLEDGE can't be used with a MDB so it is safe to always acknowledge all
            //on this session (rather than the connection consumer session)
View Full Code Here

         }
        
         if (trace) { log.trace("recovering the session"); }
         
         //Call redeliver
         SessionDelegate del = (SessionDelegate)mi.getTargetObject();
        
         int ackMode = state.getAcknowledgeMode();
        
         if (ackMode == Session.CLIENT_ACKNOWLEDGE)
         {
            List dels = state.getClientAckList();
           
            state.setClientAckList(new ArrayList());
           
            del.redeliver(dels);
  
            state.setRecoverCalled(true);
         }
         else if (ackMode == Session.AUTO_ACKNOWLEDGE || ackMode == Session.DUPS_OK_ACKNOWLEDGE || isXAAndConsideredNonTransacted(state))
         {
            DeliveryInfo info = state.getAutoAckInfo();
           
            //Don't recover if it's already to cancel
           
            if (info != null)
            {
               List redels = new ArrayList();
              
               redels.add(info);
              
               del.redeliver(redels);
              
               state.setAutoAckInfo(null);           
  
               state.setRecoverCalled(true);
            }
View Full Code Here

     
      List toRedeliver = (List)mi.getArguments()[0];
      
      if (trace) { log.trace(this + " handleRedeliver() called: " + toRedeliver); }
     
      SessionDelegate del = (SessionDelegate)mi.getTargetObject();
     
      // Need to be redelivered in reverse order.
      for (int i = toRedeliver.size() - 1; i >= 0; i--)
      {
         DeliveryInfo info = (DeliveryInfo)toRedeliver.get(i);
View Full Code Here

      MessageProxy m = (MessageProxy)mi.getArguments()[0];
      String theConsumerID = (String)mi.getArguments()[1];
      String queueName = (String)mi.getArguments()[2];
      int maxDeliveries = ((Integer)mi.getArguments()[3]).intValue();
      SessionDelegate connectionConsumerDelegate = ((SessionDelegate)mi.getArguments()[4]);
      boolean shouldAck = ((Boolean)mi.getArguments()[5]).booleanValue();
     
      if (m == null)
      {
         throw new IllegalStateException("Cannot add a null message to the session");
View Full Code Here

TOP

Related Classes of org.jboss.jms.delegate.SessionDelegate

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.