- All Implemented Interfaces:
Serializable,Comparable<ShutdownHook>,java.lang.constant.Constable
The singleton
ShutdownHook provides a means to register
ShutdownHook.Listeners that are run when JGit is uninstalled, either
- in an OSGi framework when this bundle is deactivated, or
- otherwise, when the JVM as a whole shuts down.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceObject that needs to cleanup on shutdown.Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionbooleanWhether a JGit shutdown is in progressbooleanRegister object that needs cleanup during JGit shutdown if it is not already registered.booleanUnregister object that no longer needs cleanup during JGit shutdown if it is still registered.static ShutdownHookReturns the enum constant of this class with the specified name.static ShutdownHook[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
INSTANCE
Singleton
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
register
Register object that needs cleanup during JGit shutdown if it is not already registered. Registration is disabled when JGit shutdown is already in progress.- Parameters:
l- the object to callShutdownHook.Listener.onShutdown()on when JGit shuts down- Returns:
trueif this object has been registered
-
unregister
Unregister object that no longer needs cleanup during JGit shutdown if it is still registered. Unregistration is disabled when JGit shutdown is already in progress.- Parameters:
l- the object registered to be notified for cleanup when the JVM shuts down- Returns:
trueif this object is no longer registered
-
isShutdownInProgress
public boolean isShutdownInProgress()Whether a JGit shutdown is in progress- Returns:
trueif a JGit shutdown is in progress
-