org.springframework.boot.context.event

Class ApplicationReadyEvent

  • All Implemented Interfaces:
    java.io.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
    See Also:
    ApplicationFailedEvent, Serialized Form
    • Constructor Detail

      • ApplicationReadyEvent

        public ApplicationReadyEvent(SpringApplication application,
                                     java.lang.String[] args,
                                     org.springframework.context.ConfigurableApplicationContext context,
                                     java.time.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 Detail

      • getApplicationContext

        public org.springframework.context.ConfigurableApplicationContext getApplicationContext()
        Return the application context.
        Returns:
        the context
      • getTimeTaken

        public java.time.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