for(BeanId beanId : mapBeanIds) {
Object bean = nestedBeanContext.getBean(beanId.getName());
// Add the bean from the nested context onto the parent context and then remove
// it again. This is enough to fire the wiring and end events...
parentBeanContext.notifyObservers(new BeanContextLifecycleEvent(executionContext, null, BeanLifecycle.START_FRAGMENT, beanId, bean));
parentBeanContext.addBean(beanId, bean);
parentBeanContext.notifyObservers(new BeanContextLifecycleEvent(executionContext, null, BeanLifecycle.END_FRAGMENT, beanId, bean));
parentBeanContext.removeBean(beanId, null);
}
}
} finally {
executionContext.removeAttribute(NestedExecutionVisitor.class);