Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] How can i advise program termination ?

In circumstances like this you can use Runtime.getRuntime().addShutdownHook( <your-thread> ).

On 03/05/06, Olivier Riou < tich29@xxxxxxxxx> wrote:
Hi,
I would like to advise a program termination to write collected data in a file when the program terminate rather than writting data during the execution.
I tried to use an execution pointcut on main method and write data with a after advice like this :

aspect MyAspect {
  pointcut theEnd() : execution(* *.main(..));

  after() : theEnd() {
     // write data
     ...
  }
}

The problem is that the program is still running after leaving the main method in j3d applications.

Anyone has a suggestion ?
Thanks in advance.

Tich

_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users





--
-- Adrian
adrian.colyer@xxxxxxxxx

Back to the top