org.springframework.boot.context.event

Class ApplicationStartedEvent

    • Constructor Detail

      • ApplicationStartedEvent

        public ApplicationStartedEvent(SpringApplication application,
                                       java.lang.String[] args,
                                       org.springframework.context.ConfigurableApplicationContext context,
                                       java.time.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 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 to start the application, or null if unknown.
        Returns:
        the startup time
        Since:
        2.6.0