Class LoggingListener


  • @Immutable
    public final class LoggingListener
    extends com.google.common.util.concurrent.Service.Listener
    A service listener that will log the service as it transitions between various different states.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      java.util.logging.Logger logger  
      java.lang.Class<?> sourceClass  
    • Constructor Summary

      Constructors 
      Constructor Description
      LoggingListener​(java.util.logging.Logger logger, java.lang.Class<?> sourceClass)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void failed​(com.google.common.util.concurrent.Service.State from, java.lang.Throwable throwable)  
      void running()  
      void starting()  
      void stopping​(com.google.common.util.concurrent.Service.State from)  
      void terminated​(com.google.common.util.concurrent.Service.State from)  
      • Methods inherited from class java.lang.Object

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

      • logger

        public final java.util.logging.Logger logger
      • sourceClass

        public final java.lang.Class<?> sourceClass
    • Constructor Detail

      • LoggingListener

        public LoggingListener​(java.util.logging.Logger logger,
                               java.lang.Class<?> sourceClass)
        Parameters:
        logger - The logger to use for logging the service.
        sourceClass - The source class that created the service.
    • Method Detail

      • starting

        public void starting()
        Overrides:
        starting in class com.google.common.util.concurrent.Service.Listener
      • running

        public void running()
        Overrides:
        running in class com.google.common.util.concurrent.Service.Listener
      • stopping

        public void stopping​(@Nullable
                             com.google.common.util.concurrent.Service.State from)
        Overrides:
        stopping in class com.google.common.util.concurrent.Service.Listener
      • terminated

        public void terminated​(@Nullable
                               com.google.common.util.concurrent.Service.State from)
        Overrides:
        terminated in class com.google.common.util.concurrent.Service.Listener
      • failed

        public void failed​(@Nullable
                           com.google.common.util.concurrent.Service.State from,
                           @Nullable
                           java.lang.Throwable throwable)
        Overrides:
        failed in class com.google.common.util.concurrent.Service.Listener