KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > yapbaop > demo > DemoAspect


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 yapbaop.demo;
9
10 import org.aopalliance.intercept.MethodInterceptor;
11 import org.aopalliance.intercept.MethodInvocation;
12
13 /**
14  * @author <a HREF="mailto:alex AT gnilux DOT com">Alexandre Vasseur</a>
15  */

16 public class DemoAspect implements MethodInterceptor {
17
18     public Object JavaDoc invoke(MethodInvocation methodInvocation) throws Throwable JavaDoc {
19         System.out.print("DemoAspect.invoke for: ");
20         System.out.print(methodInvocation.getMethod().getName());
21         System.out.println(" on " + ((YapbaopDemo)(methodInvocation.getThis())).m_name);
22         Object JavaDoc rval = methodInvocation.proceed();
23         return rval;
24     }
25 }
26
Popular Tags