Class ApplicationAvailabilityBean
java.lang.Object
org.springframework.boot.availability.ApplicationAvailabilityBean
- All Implemented Interfaces:
- EventListener,- ApplicationAvailability,- ApplicationListener<AvailabilityChangeEvent<?>>
public class ApplicationAvailabilityBean
extends Object
implements ApplicationAvailability, ApplicationListener<AvailabilityChangeEvent<?>>
Bean that provides an 
ApplicationAvailability implementation by listening for
 change events.- Since:
- 2.3.0
- Author:
- Brian Clozel, Phillip Webb
- See Also:
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescription<S extends AvailabilityState>
 AvailabilityChangeEvent<S>getLastChangeEvent(Class<S> stateType) Return the lastAvailabilityChangeEventreceived for a given state type.<S extends AvailabilityState>
 SReturnAvailabilityStateinformation for the application.<S extends AvailabilityState>
 SReturnAvailabilityStateinformation for the application.voidonApplicationEvent(AvailabilityChangeEvent<?> event) Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.boot.availability.ApplicationAvailabilitygetLivenessState, getReadinessStateMethods inherited from interface org.springframework.context.ApplicationListenersupportsAsyncExecution
- 
Constructor Details- 
ApplicationAvailabilityBeanpublic ApplicationAvailabilityBean()
 
- 
- 
Method Details- 
getStateDescription copied from interface:ApplicationAvailabilityReturnAvailabilityStateinformation for the application.- Specified by:
- getStatein interface- ApplicationAvailability
- Type Parameters:
- S- the state type
- Parameters:
- stateType- the state type
- defaultState- the default state to return if no event of the given type has been published yet (must not be- null).
- Returns:
- the readiness state
- See Also:
 
- 
getStateDescription copied from interface:ApplicationAvailabilityReturnAvailabilityStateinformation for the application.- Specified by:
- getStatein interface- ApplicationAvailability
- 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:
 
- 
getLastChangeEventpublic <S extends AvailabilityState> AvailabilityChangeEvent<S> getLastChangeEvent(Class<S> stateType) Description copied from interface:ApplicationAvailabilityReturn the lastAvailabilityChangeEventreceived for a given state type.- Specified by:
- getLastChangeEventin interface- ApplicationAvailability
- 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
 
- 
onApplicationEvent- Specified by:
- onApplicationEventin interface- ApplicationListener<AvailabilityChangeEvent<?>>
 
 
-