final ServiceName beanManagerBindingServiceName = contextServiceName.append("BeanManager");
InjectedValue<BeanManager> injectedBeanManager = new InjectedValue<BeanManager>();
BinderService beanManagerBindingService = new BinderService("BeanManager");
serviceTarget.addService(beanManagerBindingServiceName, beanManagerBindingService)
.addInjection(beanManagerBindingService.getManagedObjectInjector(), new ValueManagedObject(injectedBeanManager))
.addDependency(contextServiceName, NamingStore.class, beanManagerBindingService.getNamingStoreInjector())
.addDependency(beanManagerServiceName, BeanManager.class, injectedBeanManager)
.install();
deploymentUnit.addToAttachmentList(Attachments.SETUP_ACTIONS, new WeldContextSetup());
}