|
|
Event for application initialization completion?
Hi!
I'm using Spring 3.0.2.
I have few threads that cannot start doing their thing until the application is officially up and running. I would like to find a way to notify a bean that the context finished initializing all the other beans and that the application is now officially available.
(so right after this line):
2011-02-14 10:56:06,180 INFO [main] org..web.servlet.FrameworkServlet (FrameworkServlet.java:320) - FrameworkServlet 'xxxxxxxxx': initialization completed in 722 ms
I found a way to get a hold of the enclosing ApplicationContext by implementing ApplicationContextAware and supplying:
public void setApplicationContext(ApplicationContext applicationContext) ...
That's great .. but I don't know how to find out if the context is finished initializing? The API does not have anything useful for that purpose.
Thanks for your help!
Look into Spring's event handling.
Great, thanks, I managed to do what I needed by implementing ApplicationListenerlt;ContextRefreshedEventgt;.
Now I just have to make sure I catch the right one for my app |
|