Package io.micronaut.runtime.graceful
Class GracefulShutdownListener
java.lang.Object
io.micronaut.runtime.graceful.GracefulShutdownListener
- All Implemented Interfaces:
ApplicationEventListener<ShutdownEvent>,Ordered,EventListener
@Singleton
@Requires(bean=GracefulShutdownManager.class) @Requires(property="micronaut.lifecycle.graceful-shutdown.enabled",value="true",defaultValue="false")
public final class GracefulShutdownListener
extends Object
implements ApplicationEventListener<ShutdownEvent>, Ordered
Listener that intercepts
ShutdownEvent to initiate and wait for a graceful shutdown, if
configured.- Since:
- 4.9.0
- Author:
- Jonas Konrad
-
Field Summary
Fields inherited from interface io.micronaut.core.order.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Method Summary
Modifier and TypeMethodDescriptionintgetOrder()voidonApplicationEvent(ShutdownEvent event) Handle an application event.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.micronaut.context.event.ApplicationEventListener
supports
-
Method Details
-
onApplicationEvent
Description copied from interface:ApplicationEventListenerHandle an application event.- Specified by:
onApplicationEventin interfaceApplicationEventListener<ShutdownEvent>- Parameters:
event- the event to respond to
-
getOrder
public int getOrder()
-