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

public class ApplicationStartedEvent extends SpringApplicationEvent
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:
  • Constructor Details

    • ApplicationStartedEvent

      public ApplicationStartedEvent(SpringApplication application, String[] args, org.springframework.context.ConfigurableApplicationContext context, Duration timeTaken)
      Create a new ApplicationStartedEvent instance.
      Parameters:
      application - the current application
      args - the arguments the application is running with
      context - the context that was being created
      timeTaken - 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

      public Duration getTimeTaken()
      Return the time taken to start the application, or null if unknown.
      Returns:
      the startup time
      Since:
      2.6.0