public class ApplicationAvailabilityBean extends java.lang.Object implements ApplicationAvailability, org.springframework.context.ApplicationListener<AvailabilityChangeEvent<?>>
ApplicationAvailability
implementation by listening for
change events
.ApplicationAvailability
Constructor and Description |
---|
ApplicationAvailabilityBean() |
Modifier and Type | Method and Description |
---|---|
<S extends AvailabilityState> |
getLastChangeEvent(java.lang.Class<S> stateType)
Return the last
AvailabilityChangeEvent received for a given state type. |
<S extends AvailabilityState> |
getState(java.lang.Class<S> stateType)
Return
AvailabilityState information for the application. |
<S extends AvailabilityState> |
getState(java.lang.Class<S> stateType,
S defaultState)
Return
AvailabilityState information for the application. |
void |
onApplicationEvent(AvailabilityChangeEvent<?> event) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getLivenessState, getReadinessState
public <S extends AvailabilityState> S getState(java.lang.Class<S> stateType, S defaultState)
ApplicationAvailability
AvailabilityState
information for the application.getState
in interface ApplicationAvailability
S
- the state typestateType
- the state typedefaultState
- the default state to return if no event of the given type has
been published yet (must not be null
).ApplicationAvailability.getState(Class)
public <S extends AvailabilityState> S getState(java.lang.Class<S> stateType)
ApplicationAvailability
AvailabilityState
information for the application.getState
in interface ApplicationAvailability
S
- the state typestateType
- the state typenull
if no event of the given type has been
published yetApplicationAvailability.getState(Class, AvailabilityState)
public <S extends AvailabilityState> AvailabilityChangeEvent<S> getLastChangeEvent(java.lang.Class<S> stateType)
ApplicationAvailability
AvailabilityChangeEvent
received for a given state type.getLastChangeEvent
in interface ApplicationAvailability
S
- the state typestateType
- the state typenull
if no event of the given type has been
published yetpublic void onApplicationEvent(AvailabilityChangeEvent<?> event)
onApplicationEvent
in interface org.springframework.context.ApplicationListener<AvailabilityChangeEvent<?>>