KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > test > bindingsyntax > TestAspect


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.bindingsyntax;
9
10 import org.codehaus.aspectwerkz.joinpoint.JoinPoint;
11
12 /**
13  * @author <a HREF="mailto:jboner@codehaus.org">Jonas BonŽr </a>
14  */

15 public class TestAspect {
16     public Object JavaDoc advice1(final JoinPoint joinPoint) throws Throwable JavaDoc {
17         String JavaDoc last = AdviceBindingTest.flow;
18         AdviceBindingTest.flow += " ";
19         Object JavaDoc r = joinPoint.proceed();
20         AdviceBindingTest.flow = last;
21         return '1' + (String JavaDoc) r;
22     }
23
24     public Object JavaDoc advice2(final JoinPoint joinPoint) throws Throwable JavaDoc {
25         String JavaDoc last = AdviceBindingTest.flow;
26         AdviceBindingTest.flow += " ";
27         Object JavaDoc r = joinPoint.proceed();
28         AdviceBindingTest.flow = last;
29         return '2' + (String JavaDoc) r;
30     }
31 }
Popular Tags