Class ApplicationStartedEvent
java.lang.Object
java.util.EventObject
org.springframework.context.ApplicationEvent
org.springframework.boot.context.event.SpringApplicationEvent
org.springframework.boot.context.event.ApplicationStartedEvent
- All Implemented Interfaces:
Serializable
Event published once the application context has been refreshed but before any
application
and command line
runners have been called.- Since:
- 2.0.0
- See Also:
-
Field Summary
Fields inherited from class java.util.EventObject
source
-
Constructor Summary
ConstructorDescriptionApplicationStartedEvent
(SpringApplication application, String[] args, org.springframework.context.ConfigurableApplicationContext context, Duration timeTaken) Create a newApplicationStartedEvent
instance. -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.context.ConfigurableApplicationContext
Return the application context.Return the time taken to start the application, 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
-
ApplicationStartedEvent
public ApplicationStartedEvent(SpringApplication application, String[] args, org.springframework.context.ConfigurableApplicationContext context, Duration timeTaken) Create a newApplicationStartedEvent
instance.- Parameters:
application
- the current applicationargs
- the arguments the application is running withcontext
- the context that was being createdtimeTaken
- the time taken to start the application- Since:
- 2.6.0
-
-
Method Details
-
getApplicationContext
public org.springframework.context.ConfigurableApplicationContext getApplicationContext()Return the application context.- Returns:
- the context
-
getTimeTaken
Return the time taken to start the application, ornull
if unknown.- Returns:
- the startup time
- Since:
- 2.6.0
-