public interface ShutdownCallbackRegistry
|Modifier and Type||Field and Description|
System property to set to choose the ShutdownCallbackRegistry.
System property to set to override the global ability to register shutdown hooks.
Shared Marker to indicate log messages corresponding to shutdown hooks.
static final String SHUTDOWN_CALLBACK_REGISTRY
static final String SHUTDOWN_HOOK_ENABLED
static final org.apache.logging.log4j.Marker SHUTDOWN_HOOK_MARKER
Cancellable addShutdownCallback(Runnable callback)
Cancellablemust be retained on heap by caller to avoid premature garbage-collection of the registered callback (and to ensure the callback runs on shutdown).
callback- the shutdown callback to be executed upon shutdown.
nullif the shutdown hook is disabled and cannot be added.
Copyright © 1999-2021 The Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.