public void shutdown(boolean wait) {
if (state == BusState.SHUTTING_DOWN) {
return;
}
BusLifeCycleManager lifeCycleManager = this.getExtension(BusLifeCycleManager.class);
if (null != lifeCycleManager) {
lifeCycleManager.preShutdown();
}
synchronized (this) {
state = BusState.SHUTTING_DOWN;
}
destroyBeans();
synchronized (this) {
state = BusState.SHUTDOWN;
notifyAll();
}
if (null != lifeCycleManager) {
lifeCycleManager.postShutdown();
}
if (BusFactory.getDefaultBus(false) == this) {
BusFactory.setDefaultBus(null);
}