APIdia Launch Partner
Top Description Fields Constructors Methods
java.lang

pack-priv Class Shutdown

extends Object
Class Inheritance
Imports
jdk.internal.misc.VM

Package-private utility class containing data structures and logic governing the virtual-machine shutdown sequence.
Author
Mark Reinhold
Since
1.3
See Also
java.io.Console, ApplicationShutdownHooks, java.io.DeleteOnExitHook

Field Summary

Modifier and TypeField and Description
private static int
private static final Object
private static final Runnable[]
private static final Object
private static final int

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv static void
add(int
the slot in the shutdown hook array, whose element will be invoked in order during shutdown
slot
,
boolean
true to allow the hook to be registered even if the shutdown is in progress.
registerShutdownInProgress
,
Runnable
the hook to be registered
hook
)

Add a new system shutdown hook.

pack-priv static native void
pack-priv static void
exit(int status)

pack-priv static void
halt(int status)

pack-priv static native void
halt0(int status)

private static void
logRuntimeExit(int status)

private static void
pack-priv static void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

currentRunningHookback to summary
private static int currentRunningHook
haltLockback to summary
private static final Object haltLock
hooksback to summary
private static final Runnable[] hooks
lockback to summary
private static final Object lock
MAX_SYSTEM_HOOKSback to summary
private static final int MAX_SYSTEM_HOOKS

Constructor Detail

Shutdownback to summary
pack-priv Shutdown()

Method Detail

addback to summary
pack-priv static void add(int slot, boolean registerShutdownInProgress, Runnable hook)

Add a new system shutdown hook. Checks the shutdown state and the hook itself, but does not do any security checks. The registerShutdownInProgress parameter should be false except registering the DeleteOnExitHook since the first file may be added to the delete on exit list by the application shutdown hooks.

Parameters
slot:int

the slot in the shutdown hook array, whose element will be invoked in order during shutdown

registerShutdownInProgress:boolean

true to allow the hook to be registered even if the shutdown is in progress.

hook:Runnable

the hook to be registered

Exceptions
IllegalStateException:
if registerShutdownInProgress is false and shutdown is in progress; or if registerShutdownInProgress is true and the shutdown process already passes the given slot
beforeHaltback to summary
pack-priv static native void beforeHalt()
exitback to summary
pack-priv static void exit(int status)
haltback to summary
pack-priv static void halt(int status)
halt0back to summary
pack-priv static native void halt0(int status)
logRuntimeExitback to summary
private static void logRuntimeExit(int status)
runHooksback to summary
private static void runHooks()
shutdownback to summary
pack-priv static void shutdown()