public class ApplicationAvailabilityProvider extends Object implements ApplicationListener<ApplicationEvent>
Other application components can get the current state information from the
ApplicationAvailabilityProvider
, or publish application evens such as
ReadinessStateChangedEvent
and LivenessStateChangedEvent
to update the
state of the application.
Constructor and Description |
---|
ApplicationAvailabilityProvider()
Create a new
ApplicationAvailabilityProvider instance with
LivenessState.BROKEN and ReadinessState.UNREADY . |
ApplicationAvailabilityProvider(LivenessState livenessState,
ReadinessState readinessState)
Create a new
ApplicationAvailabilityProvider with the given states. |
Modifier and Type | Method and Description |
---|---|
LivenessState |
getLivenessState()
Return the
LivenessState of the application. |
ReadinessState |
getReadinessState()
Return the
ReadinessState of the application. |
void |
onApplicationEvent(ApplicationEvent event) |
public ApplicationAvailabilityProvider()
ApplicationAvailabilityProvider
instance with
LivenessState.BROKEN
and ReadinessState.UNREADY
.public ApplicationAvailabilityProvider(LivenessState livenessState, ReadinessState readinessState)
ApplicationAvailabilityProvider
with the given states.livenessState
- the liveness statereadinessState
- the readiness statepublic LivenessState getLivenessState()
LivenessState
of the application.public ReadinessState getReadinessState()
ReadinessState
of the application.public void onApplicationEvent(ApplicationEvent event)
onApplicationEvent
in interface ApplicationListener<ApplicationEvent>