Examples of MethodInvocation


Examples of org.jboss.aop.joinpoint.MethodInvocation

   public Object handleSetExceptionListener(Invocation invocation) throws Throwable
   {
      ConnectionState state = getConnectionState(invocation);
      state.setJustCreated(false);
     
      MethodInvocation mi = (MethodInvocation)invocation;
      ExceptionListener exceptionListener = (ExceptionListener)mi.getArguments()[0];
      state.getRemotingConnection().getConnectionListener().
         addJMSExceptionListener(exceptionListener);

      return null;
   }
View Full Code Here

Examples of org.jboss.aop.joinpoint.MethodInvocation

   public Object  handleRegisterFailoverListener(Invocation invocation) throws Throwable
   {
      ConnectionState state = getConnectionState(invocation);

      MethodInvocation mi = (MethodInvocation)invocation;
      FailoverListener listener = (FailoverListener)mi.getArguments()[0];

      state.getFailoverCommandCenter().registerFailoverListener(listener);

      return null;
   }
View Full Code Here

Examples of org.jboss.aop.joinpoint.MethodInvocation

   public Object handleUnregisterFailoverListener(Invocation invocation) throws Throwable
   {
      ConnectionState state = getConnectionState(invocation);

      MethodInvocation mi = (MethodInvocation)invocation;
      FailoverListener listener = (FailoverListener)mi.getArguments()[0];

      boolean result = state.getFailoverCommandCenter().unregisterFailoverListener(listener);

      return new Boolean(result);
   }
View Full Code Here

Examples of org.jboss.aop.joinpoint.MethodInvocation

          {
             log.trace("invoking non-method invocation: " + invocation + " on " + target);
          }
          else
          {
             MethodInvocation mi = (MethodInvocation)invocation;
             method = mi.getMethod();
             methodName = method.getName();

             StringBuffer sb = new StringBuffer();
             sb.append("invoking ").append(target).append('.').append(methodName).append('(');
             Object[] args = mi.getArguments();
             if (args != null)
             {
                for(int i = 0; i < args.length; i++)
                {
                   // take special precautions to hide passwords
View Full Code Here

Examples of org.jboss.aop.joinpoint.MethodInvocation

      createCache = new HashSet();
   }
  
   public Object handleCreateConsumerDelegate(Invocation invocation) throws Throwable
   {
      MethodInvocation mi = (MethodInvocation)invocation;
     
      // read permission required on the destination
      Destination dest = (Destination)mi.getArguments()[0];
     
      SessionAdvised del = (SessionAdvised)invocation.getTargetObject();
      ServerSessionEndpoint sess = (ServerSessionEndpoint)del.getEndpoint();
     
      check(dest, CheckType.READ, sess.getConnectionEndpoint());
     
      // if creating a durable subscription then need create permission
     
      String subscriptionName = (String)mi.getArguments()[3];
      if (subscriptionName != null)
      {
         // durable
         check(dest, CheckType.CREATE, sess.getConnectionEndpoint());
      }
View Full Code Here

Examples of org.jboss.aop.joinpoint.MethodInvocation

  
   public Object handleCreateBrowserDelegate(Invocation invocation) throws Throwable
   {
      // read permission required on the destination
     
      MethodInvocation mi = (MethodInvocation)invocation;
     
      Destination dest = (Destination)mi.getArguments()[0];
     
      SessionAdvised del = (SessionAdvised)invocation.getTargetObject();
      ServerSessionEndpoint sess = (ServerSessionEndpoint)del.getEndpoint();
                 
      check(dest, CheckType.READ, sess.getConnectionEndpoint());
View Full Code Here

Examples of org.jboss.aop.joinpoint.MethodInvocation

  
   public Object handleSend(Invocation invocation) throws Throwable
   {
      // anonymous producer - if destination is not null then write permissions required
     
      MethodInvocation mi = (MethodInvocation)invocation;
     
      Message m = (Message)mi.getArguments()[0];
      Destination dest = m.getJMSDestination();

      SessionAdvised del = (SessionAdvised)invocation.getTargetObject();
      ServerSessionEndpoint se = (ServerSessionEndpoint)del.getEndpoint();
      ServerConnectionEndpoint ce = se.getConnectionEndpoint();
View Full Code Here

Examples of org.jboss.aop.joinpoint.MethodInvocation

  
   // 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())
View Full Code Here

Examples of org.jboss.aop.joinpoint.MethodInvocation

      return res;
   }
  
   public Object handlePreDeliver(Invocation invocation) throws Throwable
   {
      MethodInvocation mi = (MethodInvocation)invocation;
      SessionState state = getState(invocation);
     
      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

Examples of org.jboss.aop.joinpoint.MethodInvocation

      return null;
   }
  
   public Object handlePostDeliver(Invocation invocation) throws Throwable
   {
      MethodInvocation mi = (MethodInvocation)invocation;
      SessionState state = getState(invocation);
     
      int ackMode = state.getAcknowledgeMode();
     
      if (ackMode == Session.AUTO_ACKNOWLEDGE)
      {
         // We auto acknowledge.

         SessionDelegate sd = (SessionDelegate)mi.getTargetObject();

         // It is possible that session.recover() is called inside a message listener onMessage
         // method - i.e. between the invocations of preDeliver and postDeliver. In this case we
         // don't want to acknowledge the last delivered messages - since it will be redelivered.
         if (!state.isRecoverCalled())
         {
            DeliveryInfo delivery = state.getAutoAckInfo();
           
            if (delivery == null)
            {
               throw new IllegalStateException("Cannot find delivery to AUTO_ACKNOWLEDGE");
            }
                                
            if (trace) { log.trace(this + " auto acknowledging delivery " + delivery); }
             

            // We clear the state in a finally so then we don't get a knock on
            // exception on the next ack since we haven't cleared the state. See
            // http://jira.jboss.org/jira/browse/JBMESSAGING-852

            //This is ok since the message is acked after delivery, then the client
            //could get duplicates anyway
           
            try
            {
               ackDelivery(sd, delivery);
            }
            finally
            {
               state.setAutoAckInfo(null);              
            }
         }        
         else
         {
            if (trace) { log.trace(this + " recover called, so NOT acknowledging"); }

            state.setRecoverCalled(false);
         }
      }
      else if (ackMode == Session.DUPS_OK_ACKNOWLEDGE)
      {
         List acks = state.getClientAckList();
        
         if (!state.isRecoverCalled())
         {
            if (acks.size() >= state.getDupsOKBatchSize())
            {
               // We clear the state in a finally
               // http://jira.jboss.org/jira/browse/JBMESSAGING-852
  
               SessionDelegate sd = (SessionDelegate)mi.getTargetObject();
                                         
               try
               {
                  sd.acknowledgeDeliveries(acks);
               }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.