Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] How to capture the end of a J2SE program

The main problem is that I don't really know how the program is going to be terminated because my aspect is going to be used with different programs, through Load Time Weaving

2010/1/18 James Black <planiturthian@xxxxxxxxx>
If you call the System.exit in the application, then just put an aspect before that, or, if you call one function to actually start the application, as shown below, then you could put a pointcut around prog.runProgram. It would help if you could tell more about how you know the program is about to exit.

int main(...) {
   MyProg prog = new MyProg(...);
   prog.runProgram();
   System.exit();
}

On Sun, Jan 17, 2010 at 8:57 PM, FraGMenT <poemcompiler@xxxxxxxxx> wrote:
Hello guys, I must capture the end (termination) of a J2SE program without modifying it's source code. I already use aspects to log some stuff from the programs but now I also need to do some "finalize" stuff when the program is (or about to) over.

Any clue on this subject?

If there is any non-aspect solution I'd be glad to hear it too. I wish there was something like a TerminationListener on the jvm :p


Juanjo Pardo

PS: Thanks in advance ^^'

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



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



Back to the top