Pointcut for Thread.run()?

View: New views
1 Messages — Rating Filter:   Alert me  

Pointcut for Thread.run()?

by andreas.konrad :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello AOP-Experts,

I have some code using threads like this:

public void run() {
  try {
    while (true) {
       /* some code */
       Thread.sleep( 2000 );
    }
  } catch ( InterruptedException e ) { e.printStackTrace(); }
}

Now I would like to know how much time it tooks from the moment a thread wakes up to the moment it goes sleeping again.
My problem is that I can't easily match on /* some code */ because it is not a simple function call. All code whose execution time I want to measure is included in the run method.

Can I formulate an adequate pointcut for this?

Can anyone help to fix this problem, please?

Thanks in advance,

Andreas





Jetzt komfortabel bei Arcor-Digital TV einsteigen: Mehr Happy Ends, mehr Herzschmerz, mehr Fernsehen! Erleben Sie 50 digitale TV Programme und optional 60 Pay TV Sender, einen elektronischen Programmführer mit Movie Star Bewertungen von TV Movie. Außerdem, aktuelle Filmhits und prickelnde Erotik in der Arcor-Videothek. Infos unter www.arcor.de/tv

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email