I have already found a previous SF question regarding this issue and I believe setting the init-method
and the destroy-method
properties will be sufficient. But I wanted to hopefully ask the question a different way to further my understanding.
If I understand things correctly, a class that implements org.springframework.context.Lifecycle
will behave different in a web app context (namely org.springframework.web.context.support.XmlWebApplicationContext
) than in other application contexts? It will do this because the start()
of the XmlWebApplicationContext
(which will start the contained Lifecycle beans) will have been performed before the context configuration files are loaded.
Is this correct?