KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > test > aopalliance > aspect > TestInterceptor


1 /**************************************************************************************
2  * Copyright (c) Jonas BonŽr, Alexandre Vasseur. All rights reserved. *
3  * http://aspectwerkz.codehaus.org *
4  * ---------------------------------------------------------------------------------- *
5  * The software in this package is published under the terms of the LGPL license *
6  * a copy of which has been included with this distribution in the license.txt file. *
7  **************************************************************************************/

8 package test.aopalliance.aspect;
9
10 import test.aopalliance.Test;
11 import org.aopalliance.intercept.MethodInterceptor;
12 import org.aopalliance.intercept.MethodInvocation;
13
14 /**
15  * Test interceptor for the Aop Alliance compiler extension to AspectWerkz.
16  *
17  * @author <a HREF="mailto:jboner@codehaus.org">Jonas BonŽr </a>
18  */

19 public class TestInterceptor implements MethodInterceptor {
20
21     public Object JavaDoc invoke(MethodInvocation invocation) throws Throwable JavaDoc {
22         Test.log("before-intercept ");
23         Test.log(invocation.getMethod().getName() + ' ');
24         Test.log(invocation.getThis().getClass().getName() + ' ');
25         invocation.getArguments();
26         Object JavaDoc rval = invocation.proceed();
27         Test.log("after-intercept ");
28         return rval;
29     }
30 }
31
Popular Tags