Class ApplicationReadyEvent

All Implemented Interfaces:
Serializable

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

    • ApplicationReadyEvent

      public ApplicationReadyEvent(SpringApplication application, String[] args, ConfigurableApplicationContext context, Duration timeTaken)
      Create a new ApplicationReadyEvent 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 get the application ready to service requests
      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 for the application to be ready to service requests, or null if unknown.
      Returns:
      the time taken to be ready to service requests
      Since:
      2.6.0