how can I reload spring context with different set of System variables.As in below scenario, i'm looking to load dev1 properties,initialize beans before restarting context with dev2 properties.I would like to aggregate responses of initialized beans with different System variables.
System.setProperty("env","dev1");
String configFile = "spring/app_context.xml";
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(configFile);
context.start();
context.close();
System.setProperty("env","dev2");
String configFile = "spring/app_context.xml";
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(configFile);
context.start();