5

I am reading Spring Boot reference (version 1.2.3-RELEASE) and in point 22.4 Application events and listeners point 4 states:

"An ApplicationReadyEvent is sent after the refresh and any related callbacks have been processed to indicate the application is ready to service requests."

So I tried:

SpringApplication app = new SpringApplication(LearnSpringBootApplication.class);
app.addListeners(new ApplicationListener<ApplicationReadyEvent>() {

...

but it cannot find the ApplicationReadyEvent. Has it been removed ? If so - is there any equivalent for it ?

I found this post here:

Spring Boot - Wait for web server to start

but was wondering if there is another way?

Community
  • 1
  • 1
  • https://github.com/spring-projects/spring-boot/blob/53ca15b478bca8e405821b90216021bc388c4638/spring-boot/src/main/java/org/springframework/boot/context/event/ApplicationReadyEvent.java – guido May 16 '15 at 13:04
  • 6
    `ApplicationReadyEvent` is new in 1.3.0 so I would guess that you were inadvertently looking at the wrong docs. The docs for 1.2.x are here: http://docs.spring.io/spring-boot/docs/1.2.x/reference/htmlsingle/#boot-features-application-events-and-listeners – Andy Wilkinson May 16 '15 at 17:19

0 Answers0