Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Capturing shutdown

 
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi.

I have been wondering if anyone here knows how to properly capture
the shutdown of a Java application.

I have been using the following:

pointcut appExit():
	execution(public static void *.main(..)) &&
	!cflowbelow(execution(public static void main(String[])));

This matches the execution of the outermost "main" method. With an
"after returning"-advice I wanted to capture the shutdown. However,
this does not work if "main" spawns another thread. Then the control
flow in "main" might reach the end of the method and thus trigger the
advice while another thread is still active. So I have to take care
of the threads somehow. Has anybody done something like this yet?

Cheers,
Eric

-----BEGIN PGP SIGNATURE-----
Version: PGP 8.0.3

iQA/AwUBQp8VP8wiFCm7RlWCEQJZzwCeLwNxhbSoNDDViVtt7Vr8z1ieeGMAmwZk
Y/CpZB/rdQ0GOUbQ67B35srm
=3XBh
-----END PGP SIGNATURE-----




Back to the top