RE: Capturing initial call to main method...


Subject: RE: Capturing initial call to main method...
From: Karl Lieberherr (klieberherr@earthlink.net)
Date: Sat Oct 26 2002 - 16:51:28 EDT


Hi Paul:

by coincidence, we have used this feature in the DAJ project
where we intercept the call to main and we don't execute
the application (there is no proceed()):

aspect CreateClassGraph {
  pointcut mainpc(String [] args) : call( * main(..) ) && args(args);
  void around(String [] args) : mainpc(args){
    ClassGraph cg = new ClassGraph(true, false);
    ClassGraphListener newCgListener = ClassGraphListenerFactory.getNew();
    newCgListener.ClassGraphEvent(args, cg);
  }
}

-- Karl

> -----Original Message-----
> From: Paul Freeman [mailto:pfreeman@ccs.neu.edu]
> Sent: Saturday, October 26, 2002 12:20 PM
> To: com3205@ccs.neu.edu
> Subject: Capturing initial call to main method...
>
>
> Hi Class -
>
> I think I may have told quite a few of you that you cannot capture the
> initial call to the main method in a java program with the call join
> point designation, and that instead you must use the execution join
> point designation. I was completely wrong. You can capture the main
> method with the following code:
> call(public static void main(String[]))
>
> Whether this is new or could always be done I don't know. I appologize
> for misinforming you.
>
> Paul
>
>



This archive was generated by hypermail 2b28 : Sat Oct 26 2002 - 16:48:21 EDT