Package org.jboss.jms.delegate

Examples of org.jboss.jms.delegate.SessionDelegate


     
      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

      if (trace) { log.trace("run()"); }
     
      MethodInvocation mi = (MethodInvocation)invocation;
           
      //This is the delegate for the session from the pool
      SessionDelegate del = (SessionDelegate)mi.getTargetObject();
     
      SessionState state = getState(invocation);
     
      int ackMode = state.getAcknowledgeMode();
View Full Code Here

  
   private boolean ackDelivery(SessionDelegate sess, DeliveryInfo delivery) throws Exception
   {
     if (delivery.isShouldAck())
     {
        SessionDelegate connectionConsumerSession = delivery.getConnectionConsumerSession();
       
        //If the delivery was obtained via a connection consumer we need to ack via that
        //otherwise we just use this session
       
        SessionDelegate sessionToUse = connectionConsumerSession != null ? connectionConsumerSession : sess;
       
        return sessionToUse.acknowledgeDelivery(delivery);
     }
     else
     {
       return true;
     }
View Full Code Here

  
   private void cancelDelivery(SessionDelegate sess, DeliveryInfo delivery) throws Exception
   {
     if (delivery.isShouldAck())
     {
        SessionDelegate connectionConsumerSession = delivery.getConnectionConsumerSession();
       
        //If the delivery was obtained via a connection consumer we need to cancel via that
        //otherwise we just use this session
       
        SessionDelegate sessionToUse = connectionConsumerSession != null ? connectionConsumerSession : sess;
       
        sessionToUse.cancelDelivery(new DefaultCancel(delivery.getDeliveryID(),
                                    delivery.getMessageProxy().getDeliveryCount(), false, false));     
     }
   }
View Full Code Here

         {
            DeliveryInfo info = (DeliveryInfo)acks.get(0);
           
            MessageProxy mp = info.getMessageProxy();
           
            SessionDelegate del = mp.getSessionDelegate();
           
            del.redeliver(acks);
         }
      }
   }
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();
      Executor executor = sessionState.getExecutor();
      int maxDeliveries = consumerState.getMaxDeliveries();
View Full Code Here

         {
            DeliveryInfo info = (DeliveryInfo)acks.get(0);
           
            MessageProxy mp = info.getMessageProxy();
           
            SessionDelegate del = mp.getSessionDelegate();
           
            del.redeliver(acks);
         }
      }
   }
View Full Code Here

         {
            DeliveryInfo info = (DeliveryInfo)acks.get(0);
           
            MessageProxy mp = info.getMessageProxy();
           
            SessionDelegate del = mp.getSessionDelegate();
           
            del.redeliver(acks);
         }
      }
   }
View Full Code Here

      return;
    }
   
    if (trace) { log.trace(this + " starting"); }
               
    SessionDelegate localdel = ((JBossSession)localSession).getDelegate();
   
    producer = localdel.createProducerDelegate(jbq);
   
    //We create the consumer with autoFlowControl = false
    //In this mode, the consumer does not handle it's own flow control, but it must be handled
    //manually using changeRate() methods
    //The local queue itself will manually send these messages depending on its state -
    //So effectively the message buffering is handled by the local queue, not the ClientConsumer
   
    SessionDelegate sourcedel = ((JBossSession)sourceSession).getDelegate();
   
    consumer = (ClientConsumerDelegate)sourcedel.createConsumerDelegate(jbq, null, false, null, false, false);
   
    clientConsumer = ((ConsumerState)consumer.getState()).getClientConsumer();
               
    consumer.setMessageListener(this);   
   
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.