See: Description
| Class | Description |
|---|---|
| Hooklet |
A shutdown hook that allows running in controlled order.
|
| PriorityHook |
Collects all hook that need to be run during shutdown to execute them in controlled order.
|
This package includes classes for registering shutdown hooks with specific priorities, allowing for an orderly shutdown of resources. This is particularly useful in scenarios where resources need to be released or cleaned up in a specific order during the JVM shutdown phase.
Example usage:
// Register a hook to be executed at priority 50.
PriorityHook.add(50, () -> {
// Code to execute during shutdown.
});
Hooklet,
PriorityHookCopyright © 2024. All rights reserved.