Skip to main content

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



I believe you need a combination of both solutions. If the concern your are
trying to separate is the tidying up of resources in a timely way either
when the application completes or the JVM terminates. The approach I have
used is to define an aspect that intercepts the creation of the resource
and the completion of the application. On construction it registers a
shutdown hook as well. This way regardless of how the program ends "advice"
is executed to tidy up the resources.

Matthew Webster
AOSD Project
Java Technology Centre, MP146
IBM Hursley Park, Winchester,  SO21 2JN, England
Telephone: +44 196 2816139 (external) 246139 (internal)
Email: Matthew Webster/UK/IBM @ IBMGB, matthew_webster@xxxxxxxxxx
http://w3.hursley.ibm.com/~websterm/



Back to the top