I have the following code inside a method invoked by a jsf <h:commandButton>.
It gets the spring’s ApplicationContext, meaning I can get a bean with this.
FacesContext fc = FacesContext.getCurrentInstance();
ServletContext sc = (ServletContext) fc.getExternalContext().getContext();
ApplicationContext applicationContext = org.springframework.web.context.support.WebApplicationContextUtils.getWebApplicationContext(sc);
My question is how to get the ConfigurableApplicationContext of the running spring instance.
I want to be able to call the .stop .start and .refresh methods.
Alternatively, If there is any other way to call them on the running instance please inform me !
Note: there is no main method in the application. It is a webApplication deployed on glassfish v2.1.1.
Just cast to
ConfigurableApplicationContext: