public class ApplicationAvailabilityBean extends Object implements ApplicationAvailability, ApplicationListener<AvailabilityChangeEvent<?>>
ApplicationAvailability
implementation by listening for
change events
.ApplicationAvailability
Constructor and Description |
---|
ApplicationAvailabilityBean() |
Modifier and Type | Method and Description |
---|---|
<S extends AvailabilityState> |
getLastChangeEvent(Class<S> stateType)
Return the last
AvailabilityChangeEvent received for a given state type. |
<S extends AvailabilityState> |
getState(Class<S> stateType)
Return
AvailabilityState information for the application. |
<S extends AvailabilityState> |
getState(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(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(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(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 ApplicationListener<AvailabilityChangeEvent<?>>