Class AbstractService.StateSnapshot

  • Enclosing class:
    AbstractService

    private static final class AbstractService.StateSnapshot
    extends java.lang.Object
    An immutable snapshot of the current state of the service. This class represents a consistent snapshot of the state and therefore it can be used to answer simple queries without needing to grab a lock.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) java.lang.Throwable failure
      The exception that caused this service to fail.
      (package private) boolean shutdownWhenStartupFinishes
      If true, the user requested a shutdown while the service was still starting up.
      (package private) Service.State state
      The internal state, which equals external state unless shutdownWhenStartupFinishes is true.
    • Field Detail

      • state

        final Service.State state
        The internal state, which equals external state unless shutdownWhenStartupFinishes is true.
      • shutdownWhenStartupFinishes

        final boolean shutdownWhenStartupFinishes
        If true, the user requested a shutdown while the service was still starting up.
      • failure

        @Nullable
        final java.lang.Throwable failure
        The exception that caused this service to fail. This will be null unless the service has failed.
    • Constructor Detail

      • StateSnapshot

        StateSnapshot​(Service.State internalState,
                      boolean shutdownWhenStartupFinishes,
                      @Nullable
                      java.lang.Throwable failure)