ServiceDependencyMetaData switchBoardDependency = new AnyStateServiceDependencyMetaData(switchBoard.getId(), ControllerState.START, ControllerState.INSTALLED);
dependencies.add(switchBoardDependency);
log.debug("Added switchboard dependency: " + switchBoard.getId() + " for web module: " + name);
}
// Injection Manager
InjectionManager injectionManager = unit.getAttachment(InjectionManager.class);
if (injectionManager != null)
{
// set the InjectionManager on the deployment
deployment.setInjectionManager(injectionManager);
// Setup the Injector
Environment webEnvironment = metaData.getJndiEnvironmentRefsGroup();
if (webEnvironment != null)
{
// convert JBMETA metadata to jboss-injection specific metadata
JndiEnvironmentRefsGroup jndiEnvironment = new JndiEnvironmentImpl(webEnvironment, unit.getClassLoader());
// For optimization, we'll create an Injector only if there's atleast one InjectionTarget
if (this.hasInjectionTargets(jndiEnvironment))
{
// create the injector
EEInjector eeInjector = new EEInjector(jndiEnvironment);
// add the injector the injection manager
injectionManager.addInjector(eeInjector);
// Deploy the Injector as a MC bean (so that the fully populated naming context (obtained via the SwitchBoard
// Barrier) gets injected.
String injectorMCBeanName = this.getInjectorMCBeanName(unit);
BeanMetaData injectorBMD = this.createInjectorBMD(injectorMCBeanName, eeInjector, switchBoard);
unit.addAttachment(BeanMetaData.class + ":" + injectorMCBeanName, injectorBMD);