Class ShutdownIndicator

  • All Implemented Interfaces:
    java.util.EventListener, org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware, org.springframework.context.ApplicationListener<org.springframework.context.event.ApplicationContextEvent>

    public class ShutdownIndicator
    extends java.lang.Object
    implements org.springframework.context.ApplicationContextAware, org.springframework.context.ApplicationListener<org.springframework.context.event.ApplicationContextEvent>
    Listens to ApplicationEvents to provide a simple isShuttingDown() method, so callers don't need to be Spring beans or listen to these events themselves. Intended for use by code that wishes to avoid ERROR log messages on shutdown.
    Author:
    adavis
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean isShuttingDown()  
      void onApplicationEvent​(org.springframework.context.event.ApplicationContextEvent event)  
      void setApplicationContext​(org.springframework.context.ApplicationContext applicationContext)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ShutdownIndicator

        public ShutdownIndicator()
    • Method Detail

      • isShuttingDown

        public boolean isShuttingDown()
      • setApplicationContext

        public void setApplicationContext​(org.springframework.context.ApplicationContext applicationContext)
                                   throws org.springframework.beans.BeansException
        Specified by:
        setApplicationContext in interface org.springframework.context.ApplicationContextAware
        Throws:
        org.springframework.beans.BeansException
      • onApplicationEvent

        public void onApplicationEvent​(org.springframework.context.event.ApplicationContextEvent event)
        Specified by:
        onApplicationEvent in interface org.springframework.context.ApplicationListener<org.springframework.context.event.ApplicationContextEvent>