Flow control in aspectJ and wave control

Fabiano Ricci <[email protected]>
Newsgroups gmane.comp.programming.aspect.general
Message-ID <[email protected]>
Hi all,

I have another question, please. I have a Java application and some 
aspects (defined in AspectJ). The aspects serve to monitor the Java 
program. One aspect is responsible to take an input from user keyboard 
and pass it to another aspect that implement a filter on what I must 
trace. With simple aspect monitor and target program I don't have any 
problem because the weaving between aspects and target program is task 
of AJDT. Now I need an idea to have a flow control on my aspect (when I 
need to run the target program and when my aspect): first I need to run 
one particular aspect and than the target program with another aspect 
that catches the executions in the program. The problem is more 
complicated because the target program is a black-box application, so I 
cannot modify it. Anyone have any ideas?

An Example: (Catch all the execution in program target)

First I need to obtain what package I must trace
---------
public aspect GetTrace {
    ..
    pointcut Scope(): !within(nuovo..*);       
    ..
    pointcut mainPoint(): Scope() && call (public static void 
main(String[]));
    ..
    before() : mainPoint() {
        ..
        String INPUT = readMyInput();
        ..
    }
}
---------
and than I need to run target program and wave it with the follow aspect
---------
public aspect DynamicTrace {
    ..
    pointcut Scope(): !within(nuovo..*);       
    ..
    pointcut profile(): Scope() && call(* INPUT.*(..));
    ..
    Object around(): profile() {
        ..
        logTargetProgram();
        ..
    }
}

Target Program:
..
public static void main(String[] args) {      
       doSomething();
        ....
}
..
---------

What are the best method to pass a variable between two aspect? Can I 
control the flow of all my aspects and target program?
How can I execute GetTrace and than launch the target program with 
DynamicTrace aspect ( modified with result from GetTrace)? Is Ant 
suitable for this purpose?

sorry for the length  of this message and thank you in  advance for 
replies...

best regards

-- 
Fabiano Ricci

  HomePage   --:. http://www.stalsy.it
  Blog       --:. http://blog.stalsy.com
  Public Key --:. http://www.stalsy.it/key.php
  E-Mail     --:. [email protected] || [email protected]
  ICQ        --:. 302346155
  MSN        --:. [email protected]


_______________________________________________
discuss mailing list    -    [email protected]

To unsubscribe and change options, go to:
http://aosd.net/mailman/listinfo/discuss_aosd.net

Check out the AOSD.net Wiki: http://aosd.net/wiki
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.