Mar 14th, 2012, 03:11 PM
Implementing Lifecycle interface - start() method never gets called
I wrote a simple command line application to verify this. When I create an ApplicationContext containing a single bean which implements the Lifecycle interface, the start() method never gets called. When shutting down though, the isRunning() method does get called. If true, stop() gets called as well.
Any idea why start() never gets called?
As an aside, if I implement the SmartLifecycle interface (which extends Lifecycle), the start() method does get called. Not sure why this works when the start() method is actually inherited from the Lifecycle interface.
Can anyone help me better understand what is happening here?