/*
* JBoss, Home of Professional Open Source
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
*/
import org.jboss.aop.joinpoint.Invocation;
import org.jboss.aop.Aspect;
import org.jboss.aop.Bind;

/*
 * JBoss, the OpenSource J2EE webOS
 *
 * Distributable under LGPL license.
 * See terms of license at gnu.org.
 */

/**
 *
 * @author <a href="mailto:kabir.khan@jboss.org">Kabir Khan</a>
 * @version $Revision: 1.1.8.3 $
 */
@Aspect
public class TestAspect
{
   @Bind (pointcut="execution(POJO->new())")
   public Object advice(Invocation invocation)throws Throwable
   {
      try
      {
         System.out.println("<<< Entering TestAspect.advice type:" + invocation);
         return invocation.invokeNext();
      }
      finally
      {
         System.out.println("<<< Leaving TestAspect.advice type:" + invocation);
      }
   }

   @Bind (pointcut="execution(POJO->new())")   
   public Object otherAdvice(Invocation invocation)throws Throwable
   {
      try
      {
         System.out.println("<<< Entering TestAspect.otherAdvice type:" + invocation);
         return invocation.invokeNext();
      }
      finally
      {
         System.out.println("<<< Leaving TestAspect.otherAdvice type:" + invocation);
      }
   }

}
