Interface StatefulService

All Superinterfaces:
AutoCloseable, Service, ShutdownableService, SuspendableService
All Known Implementing Classes:
ServiceSupport, Transformer, Validator

public interface StatefulService extends SuspendableService, ShutdownableService
A Service which has all the lifecycle events and offers details about its current state.
  • Method Details

    • getStatus

      ServiceStatus getStatus()
      Returns the current status
      Returns:
      the current status
    • isStarted

      boolean isStarted()
      Whether the service is started
      Returns:
      true if this service has been started
    • isStarting

      boolean isStarting()
      Whether the service is starting
      Returns:
      true if this service is being started
    • isStopping

      boolean isStopping()
      Whether the service is stopping
      Returns:
      true if this service is in the process of stopping
    • isStopped

      boolean isStopped()
      Whether the service is stopped
      Returns:
      true if this service is stopped
    • isSuspending

      boolean isSuspending()
      Whether the service is suspending
      Returns:
      true if this service is in the process of suspending
    • isRunAllowed

      boolean isRunAllowed()
      Helper methods so the service knows if it should keep running. Returns false if the service is being stopped or is stopped.
      Returns:
      true if the service should continue to run.