Package io.micronaut.runtime.graceful
Class GracefulShutdownListener
java.lang.Object
io.micronaut.runtime.graceful.GracefulShutdownListener
- All Implemented Interfaces:
io.micronaut.context.event.ApplicationEventListener<io.micronaut.context.event.ShutdownEvent>,io.micronaut.core.order.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 io.micronaut.context.event.ApplicationEventListener<io.micronaut.context.event.ShutdownEvent>, io.micronaut.core.order.Ordered
Listener that intercepts
ShutdownEvent to initiate and wait for a graceful shutdown, if
configured.- Since:
- 4.9.0
-
Field Summary
Fields inherited from interface io.micronaut.core.order.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Method Summary
Modifier and TypeMethodDescriptionintgetOrder()voidonApplicationEvent(io.micronaut.context.event.ShutdownEvent 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
public void onApplicationEvent(io.micronaut.context.event.ShutdownEvent event) - Specified by:
onApplicationEventin interfaceio.micronaut.context.event.ApplicationEventListener<io.micronaut.context.event.ShutdownEvent>
-
getOrder
public int getOrder()- Specified by:
getOrderin interfaceio.micronaut.core.order.Ordered
-