Class 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
Author:
Andy Wilkinson
See Also:
  • Constructor Details

    • ApplicationStartedEvent

      public ApplicationStartedEvent(SpringApplication application, String[] args, 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 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