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 via AvailabilityChangeEvent.publish(org.springframework.context.ApplicationContext, S)
.
- Since:
- 2.3.0
-
Method Summary
Modifier and TypeMethodDescription<S extends AvailabilityState>
AvailabilityChangeEvent<S>getLastChangeEvent
(Class<S> stateType) Return the lastAvailabilityChangeEvent
received for a given state type.default LivenessState
Return theLivenessState
of the application.default ReadinessState
Return theReadinessState
of the application.<S extends AvailabilityState>
SReturnAvailabilityState
information for the application.<S extends AvailabilityState>
SReturnAvailabilityState
information for the application.
-
Method Details
-
getLivenessState
Return theLivenessState
of the application.- Returns:
- the liveness state
-
getReadinessState
Return theReadinessState
of the application.- Returns:
- the readiness state
-
getState
ReturnAvailabilityState
information 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
ReturnAvailabilityState
information for the application.- Type Parameters:
S
- the state type- Parameters:
stateType
- the state type- Returns:
- the readiness state or
null
if no event of the given type has been published yet - See Also:
-
getLastChangeEvent
Return the lastAvailabilityChangeEvent
received for a given state type.- Type Parameters:
S
- the state type- Parameters:
stateType
- the state type- Returns:
- the readiness state or
null
if no event of the given type has been published yet
-