Class ApplicationReadyEvent
java.lang.Object
java.util.EventObject
org.springframework.context.ApplicationEvent
org.springframework.boot.context.event.SpringApplicationEvent
org.springframework.boot.context.event.ApplicationReadyEvent
- All Implemented Interfaces:
Serializable
Event published as late as conceivably possible to indicate that the application is
ready to service requests. The source of the event is the
SpringApplication
itself, but beware of modifying its internal state since all initialization steps will
have been completed by then.- Since:
- 1.3.0
- Author:
- Stephane Nicoll, Chris Bono
- See Also:
-
Field Summary
Fields inherited from class java.util.EventObject
source
-
Constructor Summary
ConstructorDescriptionApplicationReadyEvent
(SpringApplication application, String[] args, ConfigurableApplicationContext context, Duration timeTaken) Create a newApplicationReadyEvent
instance. -
Method Summary
Modifier and TypeMethodDescriptionReturn the application context.Return the time taken for the application to be ready to service requests, ornull
if unknown.Methods inherited from class org.springframework.boot.context.event.SpringApplicationEvent
getArgs, getSpringApplication
Methods inherited from class org.springframework.context.ApplicationEvent
getTimestamp
Methods inherited from class java.util.EventObject
getSource, toString
-
Constructor Details
-
ApplicationReadyEvent
public ApplicationReadyEvent(SpringApplication application, String[] args, ConfigurableApplicationContext context, Duration timeTaken) Create a newApplicationReadyEvent
instance.- Parameters:
application
- the current applicationargs
- the arguments the application is running withcontext
- the context that was being createdtimeTaken
- the time taken to get the application ready to service requests- Since:
- 2.6.0
-
-
Method Details
-
getApplicationContext
Return the application context.- Returns:
- the context
-
getTimeTaken
Return the time taken for the application to be ready to service requests, ornull
if unknown.- Returns:
- the time taken to be ready to service requests
- Since:
- 2.6.0
-