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 Type
    Method
    Description
    int
     
    void
    onApplicationEvent(io.micronaut.context.event.ShutdownEvent event)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface io.micronaut.context.event.ApplicationEventListener

    supports
  • Method Details

    • onApplicationEvent

      public void onApplicationEvent(io.micronaut.context.event.ShutdownEvent event)
      Specified by:
      onApplicationEvent in interface io.micronaut.context.event.ApplicationEventListener<io.micronaut.context.event.ShutdownEvent>
    • getOrder

      public int getOrder()
      Specified by:
      getOrder in interface io.micronaut.core.order.Ordered