Package org.jboss.aop.joinpoint

Examples of org.jboss.aop.joinpoint.MethodInvocation


   // Public ---------------------------------------------------------------------------------------

   public Object handleSend(Invocation invocation) throws Throwable
   {
      MethodInvocation mi = (MethodInvocation)invocation;

      Object[] args = mi.getArguments();

      Destination destination = (Destination)args[0];
      Message m = (Message)args[1];
      int deliveryMode = ((Integer)args[2]).intValue();
      int priority = ((Integer)args[3]).intValue();
View Full Code Here


   // Public ---------------------------------------------------------------------------------------

   public Object handleCreateConsumerDelegate(Invocation invocation) throws Throwable
   {
      MethodInvocation mi = (MethodInvocation)invocation;

      ConsumerDelegate consumerDelegate = (ConsumerDelegate)invocation.invokeNext();

      boolean isCC = ((Boolean)mi.getArguments()[4]).booleanValue();

      // 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();
      long redeliveryDelay = consumerState.getRedeliveryDelay();
     
      //We need the queue name for recovering any deliveries after failover
      String queueName = null;
      if (consumerState.getSubscriptionName() != null)
      {
         // I have to use the clientID from connectionDelegate instead of connectionState...
         // this is because when a pre configured CF is used we need to get the clientID from
         // server side.
         // This was a condition verified by the TCK and it was fixed as part of
         // http://jira.jboss.com/jira/browse/JBMESSAGING-939
         queueName = MessageQueueNameHelper.
            createSubscriptionName(((ConnectionDelegate)connectionState.getDelegate()).getClientID(),
                                   consumerState.getSubscriptionName());
      }
      else if (consumerState.getDestination().isQueue())
      {
         queueName = consumerState.getDestination().getName();
      }
     
      boolean autoFlowControl = ((Boolean)mi.getArguments()[5]).booleanValue();
     
      ClientConsumer messageHandler =
         new ClientConsumer(isCC, sessionState.getAcknowledgeMode(),
                            sessionDelegate, consumerDelegate, consumerID, queueName,
                            prefetchSize, executor, maxDeliveries, consumerState.isShouldAck(),
View Full Code Here

   }

   public Object handleReceive(Invocation invocation) throws Throwable
   {
      MethodInvocation mi = (MethodInvocation)invocation;
      Object[] args = mi.getArguments();
      long timeout = (args == null || args.length==0) ? 0 : ((Long)args[0]).longValue();
     
      return getClientConsumer(invocation).receive(timeout);
   }
View Full Code Here

      return getClientConsumer(invocation).receive(-1);
   }
  
   public Object handleSetMessageListener(Invocation invocation) throws Throwable
   {  
      MethodInvocation mi = (MethodInvocation)invocation;
      Object[] args = mi.getArguments();
      MessageListener l = (MessageListener)args[0];
     
      getClientConsumer(invocation).setMessageListener(l);
     
      return null;
View Full Code Here

      ClientSessionDelegate sessionDelegate = (ClientSessionDelegate)invocation.invokeNext();
      DelegateSupport delegate = (DelegateSupport)sessionDelegate;

      ConnectionState connectionState = (ConnectionState)getState(invocation);

      MethodInvocation mi = (MethodInvocation)invocation;
      boolean transacted = ((Boolean)mi.getArguments()[0]).booleanValue();
      int ackMode = ((Integer)mi.getArguments()[1]).intValue();
      boolean xa = ((Boolean)mi.getArguments()[2]).booleanValue();

      SessionState sessionState =
         new SessionState(connectionState, sessionDelegate, transacted,
                          ackMode, xa, sessionDelegate.getDupsOKBatchSize(),
                          connectionState.isEnableOrderingGroup(), connectionState.getDefaultOrderingGroupName());
View Full Code Here

      ClientConsumerDelegate consumerDelegate = (ClientConsumerDelegate)invocation.invokeNext();
      DelegateSupport delegate = (DelegateSupport)consumerDelegate;

      SessionState sessionState = (SessionState)getState(invocation);

      MethodInvocation mi = (MethodInvocation)invocation;
      JBossDestination dest = (JBossDestination)mi.getArguments()[0];
      String selector = (String)mi.getArguments()[1];
      boolean noLocal = ((Boolean)mi.getArguments()[2]).booleanValue();
      String subscriptionName = (String)mi.getArguments()[3];
      boolean connectionConsumer = ((Boolean)mi.getArguments()[4]).booleanValue();

      String consumerID = consumerDelegate.getID();
      int bufferSize = consumerDelegate.getBufferSize();
      int maxDeliveries = consumerDelegate.getMaxDeliveries();
      long redeliveryDelay = consumerDelegate.getRedeliveryDelay();
View Full Code Here

      ProducerDelegate producerDelegate = new ClientProducerDelegate();
      DelegateSupport delegate = (DelegateSupport)producerDelegate;

      SessionState sessionState = (SessionState)getState(invocation);

      MethodInvocation mi = (MethodInvocation)invocation;
      Destination dest = ((Destination)mi.getArguments()[0]);

      ProducerState producerState = new ProducerState(sessionState, producerDelegate, dest);

      if (sessionState.isEnableOrderingGroup())
      {
View Full Code Here

      return producerDelegate;
   }

   public Object handleCreateBrowserDelegate(Invocation invocation) throws Throwable
   {
      MethodInvocation mi = (MethodInvocation)invocation;

      ClientBrowserDelegate browserDelegate = (ClientBrowserDelegate)invocation.invokeNext();
      DelegateSupport delegate = (DelegateSupport)browserDelegate;

      SessionState sessionState = (SessionState)getState(invocation);

      JBossDestination destination = (JBossDestination)mi.getArguments()[0];
      String selector = (String)mi.getArguments()[1];

      BrowserState state =
         new BrowserState(sessionState, browserDelegate, destination, selector);

      delegate.setState(state);
View Full Code Here

  
   // Public --------------------------------------------------------
  
   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

   
   }
  
   public Object handlePreDeliver(Invocation invocation) throws Throwable
   {
      MethodInvocation mi = (MethodInvocation)invocation;
      SessionState state = getState(invocation);
     
      synchronized (state)
      {
     
         int ackMode = state.getAcknowledgeMode();
        
         Object[] args = mi.getArguments();
         DeliveryInfo info = (DeliveryInfo)args[0];
        
         if (ackMode == Session.CLIENT_ACKNOWLEDGE)
         {
            // We collect acknowledgments in the list
View Full Code Here

TOP

Related Classes of org.jboss.aop.joinpoint.MethodInvocation

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.