~ubuntu-branches/ubuntu/natty/aspectj/natty

« back to all changes in this revision

Viewing changes to org.aspectj/modules/tests/design/reflect/SimpleAround.java

  • Committer: Bazaar Package Importer
  • Author(s): Damien Raude-Morvan
  • Date: 2009-10-04 16:37:23 UTC
  • mfrom: (1.1.3 upstream) (3.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20091004163723-ck4y7j7fhjxskkie
Tags: 1.6.6+dfsg-1
* New upstream release.
  - Update 02_use_gjdoc.diff patch
* Update my email address

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
import org.aspectj.lang.reflect.*;
2
 
 
3
 
public class SimpleAround {
4
 
    public static void main(String[] args) {
5
 
        new SimpleAround().foo("hi");
6
 
    }
7
 
 
8
 
    void foo(String s) {
9
 
        System.out.println("foo(" + s + ")");
10
 
    }
11
 
}
12
 
 
13
 
aspect A {
14
 
    static around(String x) returns void: executions(void *.foo(x)) {
15
 
        System.out.println("calling foo with: " + x +", " + thisStaticJoinPoint);
16
 
        proceed(x);
17
 
        System.out.println("returning from: " + thisJoinPoint); //((CallJoinPoint)thisJoinPoint).getParameters()[0]);
18
 
    }
19
 
 
20
 
    static before(): executions(void *.foo(String)) {
21
 
        System.out.println("entering: " + thisJoinPoint);
22
 
    }
23
 
 
24
 
    //static around() returns void: calls(void *.foo(String)) {
25
 
    //System.out.println(thisStaticJoinPoint);
26
 
    //proceed();
27
 
    //}
28
 
 
29
 
 
30
 
}