/*
 * JBoss, the OpenSource EJB server
 *
 * Distributable under LGPL license.
 * See terms of license at gnu.org.
 */
package org.jboss.ejb3.test.initial;

import javax.ejb.AroundInvoke;
import javax.ejb.InvocationContext;

/**
 * @author <a href="mailto:kabir.khan@jboss.org">Kabir Khan</a>
 * @version $Revision: 1.2.6.4 $
 */
public class SecondInterceptor {

   @AroundInvoke
   public Object twoMethod(InvocationContext ctx) throws Exception
   {
      if (ctx.getMethod().getName().equals("testMethod"))
      {
         System.out.println("Intercepting in SecondInterceptor.twoMethod()");
         int val = (Integer)ctx.getContextData().get("DATA");

         ctx.getContextData().put("DATA", new Integer(val + 2000));
      }
      return ctx.proceed();
   }
}
