As I understand,I can have varying lifecycle of services running with Spring. Like Service 1 needs to be running always, service 2 would be started on demand and shutdown after service.
Correct me if I am wrong,
cheers,
-PandaSK
As I understand,I can have varying lifecycle of services running with Spring. Like Service 1 needs to be running always, service 2 would be started on demand and shutdown after service.
Correct me if I am wrong,
cheers,
-PandaSK
Service 1 should be a bean definition with singleton="true" (default anyway). The lifecycle of this object will be that of the BeanFactory that owns it.
Service 2 should be a bean definition with singleton="false". Then every getBean() call will get a new instance, and the BeanFactory won't hold onto that instance.