Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] pointcut on termination of java program

Hi

I would like to do something (close an OutputStream) when a program exits. In a single threaded application, it is possible to write:

private pointcut main () : execution (public static void main (String[]));
after () : main () {
	//do something
}

But when the application is multithreaded, the end of the main method does not imply the end of the program. I've been looking in "the java language specification" and other documents to see if there is (for example) some methode that's always called near the ending of an application... but I have not been able to find anything.

any ideas on a pointcut to capture the join point "the end of the program"?

thanks in advance,
Jan Van Besien



Back to the top