...
- be lightweight and simple.
- be thread-safe.
- hold locks when accessing data and release those locks when done.
lack reliance on system avoid relying on system services, because the services themselves may be shutting shut down (for example, the logger may be shut down from another hook). Instead of one serviceWiki Markup
Wiki Markup |
---|
To avoid race conditions or deadlock between shutdown actions, it may be better to run a series of shutdown tasks from one thread by using a single shutdown hook \[[Goetz 2006|AA. Bibliography#Goetz 06]\]. |
This compliant solution shows the standard method to install a hook.
...
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="e5fbc9a90dc61596-027317c1-40e64a14-b979b2ba-55c3192fcc98300699a26ee2"><ac:plain-text-body><![CDATA[ | [ISO/IEC TR 24772:2010 | http://www.aitcnet.org/isai/] | Termination Strategy [REU] | ]]></ac:plain-text-body></ac:structured-macro> |
CWE-705. Incorrect control flow scoping |
...
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="1bcc61fdc7bb56d6-f9038889-4e6b4539-aa429fd3-4b5b9eb575fbd35f2ac92e9e"><ac:plain-text-body><![CDATA[ | [[API 06 | AA. Bibliography#API 06]] | [Class | http://download.oracle.com/javase/6/docs/api/java/lang/Runtime.html] | ]]></ac:plain-text-body></ac:structured-macro> |
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="486afa5220f6e274-45198b3b-4317415d-9e9ba8fb-fde5d405de6efbc451d7f582"><ac:plain-text-body><![CDATA[ | [[ISO/IEC TR 24772:2010 | AA. Bibliography#ISO/IEC TR 24772-2010]] | Section 6.46, Termination Strategy [REU] | ]]></ac:plain-text-body></ac:structured-macro> |
...