Skip to main content

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

Have you tried investigating
java.lang.Runtime.addShutdownHook(java.lang.Thread)
http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Runtime.html#addShutdownHook(java.lang.Thread)

Cheers,
Val

----- Original Message ----- 
From: "Eric Bodden" <eric@xxxxxxxxx>
To: <aspectj-users@xxxxxxxxxxx>
Sent: Thursday, June 02, 2005 4:18 PM
Subject: [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-----
>
>
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>




Back to the top