I need to reinject a dependency once it is initialized w/o re-initializing of Application Context.
in detail below is what my requirement
if DB is down application should not perform any transaction , once DB is up application should resume.
this is what i am doing
i have created mongoTemplate , autowiring with attr (required=false). so that when application is getting deployed , even though DB is down ,deployment should not fail .
problem :::
but when DB will be up is there any way to reinitialize mongoTemplate and inject it again w/o rebooting server or re-deployment of application.