接口 ApplicationAvailability

所有已知实现类:
ApplicationAvailabilityBean

public interface ApplicationAvailability
Provides availability state information for the application.

Components can inject this class to get the current state information. To update the state of the application an AvailabilityChangeEvent should be published to the application context with directly or through AvailabilityChangeEvent.publish(org.springframework.context.ApplicationContext, S).

从以下版本开始:
2.3.0
作者:
Brian Clozel, Phillip Webb
  • 方法详细资料

    • getLivenessState

      default LivenessState getLivenessState()
      Return the LivenessState of the application.
      返回:
      the liveness state
    • getReadinessState

      default ReadinessState getReadinessState()
      Return the ReadinessState of the application.
      返回:
      the readiness state
    • getState

      <S extends AvailabilityState> S getState(Class<S> stateType, S defaultState)
      Return AvailabilityState information for the application.
      类型参数:
      S - the state type
      参数:
      stateType - the state type
      defaultState - the default state to return if no event of the given type has been published yet (must not be null).
      返回:
      the readiness state
      另请参阅:
    • getState

      <S extends AvailabilityState> S getState(Class<S> stateType)
      Return AvailabilityState information for the application.
      类型参数:
      S - the state type
      参数:
      stateType - the state type
      返回:
      the readiness state or null if no event of the given type has been published yet
      另请参阅:
    • getLastChangeEvent

      <S extends AvailabilityState> AvailabilityChangeEvent<S> getLastChangeEvent(Class<S> stateType)
      Return the last AvailabilityChangeEvent received for a given state type.
      类型参数:
      S - the state type
      参数:
      stateType - the state type
      返回:
      the readiness state or null if no event of the given type has been published yet