Examples of MethodInvocation


Examples of org.jboss.aop.joinpoint.MethodInvocation

   /**
    * Used for client acknowledge.
    */
   public Object handleAcknowledgeAll(Invocation invocation) throws Throwable
   {   
      MethodInvocation mi = (MethodInvocation)invocation;
      SessionState state = getState(invocation);
      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

Examples of org.jboss.aop.joinpoint.MethodInvocation

    */
   public Object handleRecover(Invocation invocation) throws Throwable
   {
      if (trace) { log.trace("recover called"); }
     
      MethodInvocation mi = (MethodInvocation)invocation;
           
      SessionState state = getState(invocation);
     
      if (state.isTransacted())
      {
         throw new IllegalStateException("Cannot recover a transacted session");
      }
     
      if (trace) { log.trace("recovering the session"); }
      
      //Call redeliver
      SessionDelegate del = (SessionDelegate)mi.getTargetObject();
     
      int ackMode = state.getAcknowledgeMode();
     
      if (ackMode == Session.CLIENT_ACKNOWLEDGE)
      {
View Full Code Here

Examples of org.jboss.aop.joinpoint.MethodInvocation

    *
    *
    */
   public Object handleRedeliver(Invocation invocation) throws Throwable
   {           
      MethodInvocation mi = (MethodInvocation)invocation;
      SessionState state = getState(invocation);           
           
      // We put the messages back in the front of their appropriate consumer buffers
     
      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

Examples of org.jboss.aop.joinpoint.MethodInvocation

         // the session is non-XA and transacted, or XA and enrolled in a global transaction, so
         // we add the message to a transaction instead of sending it now. An XA session that has
         // not been enrolled in a global transaction behaves as a non-transacted session.

         ConnectionState connState = (ConnectionState)state.getParent();
         MethodInvocation mi = (MethodInvocation)invocation;
         Message m = (Message)mi.getArguments()[0];

         if (trace) { log.trace("sending message " + m + " transactionally, queueing on resource manager txID=" + txID + " sessionID= " + state.getSessionID()); }

         connState.getResourceManager().addMessage(txID, state.getSessionID(), (JBossMessage)m);
View Full Code Here

Examples of org.jboss.aop.joinpoint.MethodInvocation

  
   public Object handleCreateObjectMessage(Invocation invocation) throws Throwable
   {
      JBossObjectMessage jbm = new JBossObjectMessage(0);
      
      MethodInvocation mi = (MethodInvocation)invocation;
     
      if (mi.getArguments() != null)
      {
         jbm.setObject((Serializable)mi.getArguments()[0]);
      }
     
      return new ObjectMessageProxy(jbm);
   }
View Full Code Here

Examples of org.jboss.aop.joinpoint.MethodInvocation

  
   public Object handleCreateTextMessage(Invocation invocation) throws Throwable
  
      JBossTextMessage jbm = new JBossTextMessage(0);
     
      MethodInvocation mi = (MethodInvocation)invocation;
     
      if (mi.getArguments() != null)
      {
         jbm.setText((String)mi.getArguments()[0]);
      }
     
      return new TextMessageProxy(jbm);
   }  
View Full Code Here

Examples of org.jboss.aop.joinpoint.MethodInvocation

  
   public Object handleSetMessageListener(Invocation invocation) throws Throwable
   {
      if (trace) { log.trace("setMessageListener()"); }
     
      MethodInvocation mi = (MethodInvocation)invocation;
     
      MessageListener listener = (MessageListener)mi.getArguments()[0];
     
      if (listener == null)
      {
         throw new IllegalStateException("Cannot set a null MessageListener on the session");
      }
View Full Code Here

Examples of org.jboss.aop.joinpoint.MethodInvocation

  
   public Object handleCreateConnectionConsumer(Invocation invocation) throws Throwable
   {
      if (trace) { log.trace("createConnectionConsumer()"); }
     
      MethodInvocation mi = (MethodInvocation)invocation;
     
      JBossDestination dest = (JBossDestination)mi.getArguments()[0];
      String subscriptionName = (String)mi.getArguments()[1];
      String messageSelector = (String)mi.getArguments()[2];
      ServerSessionPool sessionPool = (ServerSessionPool)mi.getArguments()[3];
      int maxMessages = ((Integer)mi.getArguments()[4]).intValue();
     
      return new JBossConnectionConsumer((ConnectionDelegate)mi.getTargetObject(), dest,
                                         subscriptionName, messageSelector, sessionPool,
                                         maxMessages);
   }
View Full Code Here

Examples of org.jboss.aop.joinpoint.MethodInvocation

  
   public Object handleAddAsfMessage(Invocation invocation) throws Throwable
   {
      if (trace) { log.trace("addAsfMessage()"); }
     
      MethodInvocation mi = (MethodInvocation)invocation;
     
      // Load the session with a message to be processed during a subsequent call to run()

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

Examples of org.jboss.aop.joinpoint.MethodInvocation

   public Object handleRun(Invocation invocation) throws Throwable
   {
      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
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.