containerBMDBuilder.setConstructorValue(container);
DependencyPolicy containerDependencyPolicy = container.getDependencyPolicy();
// Add dependency on switchboard
Barrier switchBoard = unit.getAttachment(Barrier.class);
// the container cannot function without an SwitchBoard Barrier
if (switchBoard == null)
{
throw new RuntimeException("No SwitchBoard Barrier found for bean: " + container.getEjbName() + " in unit: " + unit);
}
// add dependency on START (and not INSTALLED) state of Switchboard, since the container only requires a fully populated ENC context,
// but doesn't require a invokable context. An invokable context is only needed by Injector.
containerBMDBuilder.addDemand(switchBoard.getId(), ControllerState.CREATE, ControllerState.START, null);
logger.debug("Added dependency on switchboard " + switchBoard.getId() + " for container " + container.getName());
InjectionManager injectionManager = unit.getAttachment(InjectionManager.class);
// the container cannot function without an InjectionManager
if (injectionManager == null)
{