Interface ApplicationAvailability
- All Known Implementing Classes:
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).
- Since:
- 2.3.0
- Author:
- Brian Clozel, Phillip Webb
-
Method Summary
Modifier and TypeMethodDescription<S extends AvailabilityState>
AvailabilityChangeEvent<S>getLastChangeEvent(Class<S> stateType) Return the lastAvailabilityChangeEventreceived for a given state type.default LivenessStateReturn theLivenessStateof the application.default ReadinessStateReturn theReadinessStateof the application.<S extends AvailabilityState>
SReturnAvailabilityStateinformation for the application.<S extends AvailabilityState>
SReturnAvailabilityStateinformation for the application.
-
Method Details
-
getLivenessState
Return theLivenessStateof the application.- Returns:
- the liveness state
-
getReadinessState
Return theReadinessStateof the application.- Returns:
- the readiness state
-
getState
ReturnAvailabilityStateinformation for the application.- Type Parameters:
S- the state type- Parameters:
stateType- the state typedefaultState- the default state to return if no event of the given type has been published yet (must not benull).- Returns:
- the readiness state
- See Also:
-
getState
ReturnAvailabilityStateinformation for the application.- Type Parameters:
S- the state type- Parameters:
stateType- the state type- Returns:
- the readiness state or
nullif no event of the given type has been published yet - See Also:
-
getLastChangeEvent
Return the lastAvailabilityChangeEventreceived for a given state type.- Type Parameters:
S- the state type- Parameters:
stateType- the state type- Returns:
- the readiness state or
nullif no event of the given type has been published yet
-