//we shouldn't be shutting down
ClassPathXmlApplicationContext ctx =
new ClassPathXmlApplicationContext(new String[] {"/org/apache/cxf/jaxws/spring/servers.xml"});
final Bus b = (Bus)ctx.getBean("cxf");
BusLifeCycleManager lifeCycleManager = b.getExtension(BusLifeCycleManager.class);
BusLifeCycleListener listener = new BusLifeCycleListener() {
public void initComplete() {
}
public void postShutdown() {
b.setProperty("post.was.called", Boolean.TRUE);
}
public void preShutdown() {
b.setProperty("pre.was.called", Boolean.TRUE);
}
};
lifeCycleManager.registerLifeCycleListener(listener);
ClassPathXmlApplicationContext ctx2 =
new ClassPathXmlApplicationContext(new String[] {"/org/apache/cxf/jaxws/spring/child.xml"},
ctx);
ctx2.close();