KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > examples > cflow > Target


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 examples.cflow;
9
10 /**
11  * @author <a HREF="mailto:jboner@codehaus.org">Jonas BonŽr </a>
12  */

13 public class Target {
14
15     public void step1() {
16         System.out.println(" --> invoking step1");
17         step2();
18     }
19
20     public void step2() {
21         System.out.println(" --> invoking step2");
22     }
23
24     public static void main(String JavaDoc[] args) {
25         Target target = new Target();
26         System.out.println("\n--------------------------");
27         System.out.println("step2 is called in the cflow of step1 => should trigger the advice");
28         target.step1();
29         System.out.println("\n--------------------------");
30         System.out
31                 .println("step2 is called directly (not in cflow of step1) => should NOT trigger the advice");
32         target.step2();
33     }
34 }
Popular Tags