Wiki Markup |
---|
When certain kinds of errors are detected, such as irrecoverable logic errors, rather than risk data corruption by continuing to execute in an indeterminate state, the appropriate strategy may be for the system to quickly shut down, allowing the operator to start it afresh in a determinate state. Section 6.46, "Termination Strategy \[REU\]," \[[ISO/IEC TR 24772:2010|AA. Bibliography#ISOReferences#ISO/IEC TR 24772-2010]\] says: |
...
Wiki Markup |
---|
{{Runtime.exit()}} is the typical way of exiting a program. According to the Java API \[[API 06|AA. Bibliography#APIReferences#API 06]\] {{Runtime.exit()}}: |
...
Wiki Markup |
---|
{{Runtime.halt()}} is similar to {{Runtime.exit()}} but does _not_ run shutdown hooks or finalizers. According to the Java API \[[API 06|AA. Bibliography#APIReferences#API 06]\], {{Runtime.halt()}} |
...
Wiki Markup |
---|
According to the Java API \[[API 2006|AA. Bibliography#APIReferences#API 06]\], Class {{Runtime}}, method {{addShutdownHook()}}, |
...
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#GoetzReferences#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="30bb11a1d14bbfed-2975050f-43cd4033-bd48bdf9-3836cbeda5fde8ce36185f2d"><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="ca832bb0cc5064a6-04fa70a5-476448f3-af33bcec-77b97cf5d5076f0ab65fec69"><ac:plain-text-body><![CDATA[ | [[API 06 | AA. Bibliography#API References#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="e9c27b18acbd85d3-fbcbc8b9-4a1045fd-b3cd87c6-50c4191a0110ae2c74c6eb13"><ac:plain-text-body><![CDATA[ | [[ISO/IEC TR 24772:2010 | AA. Bibliography#ISOReferences#ISO/IEC TR 24772-2010]] | Section 6.46, Termination Strategy [REU] | ]]></ac:plain-text-body></ac:structured-macro> |
...