In a spring MVC application, I initialize a variable in one of the service classes using the following approach:
ApplicationContext context = new C
The method close has been added to ConfigurableApplicationContext interface, so the best you can do to get access to it is:
ConfigurableApplicationContext context = new ClassPathXmlApplicationContext( "/app-context.xml"); // Use the context... context.close();