log.info("\t" + smd.getSupply());
}
if(service instanceof EJBContainer)
{
EJBContainer container = EJBContainer.class.cast(service);
// TODO: use an informer
JavaEEModule module = container.getModule();
String moduleName = stripSuffix(module.getName());
JavaEEApplication app = module.getApplication();
String appName = app != null ? stripSuffix(app.getName()) : null;
String scopedBeanName = "application=" + (appName != null ? appName : moduleName) + ",module=" + moduleName + ",component=" + container.getEjbName();
String encFactoryBeanName = "jboss.ejb3:" + scopedBeanName + ",service=EjbEncFactory";
// create an EjbEncFactory for this container
{
BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder(encFactoryBeanName, NamingComponentEjbEncFactory.class.getName());
String componentBeanName = "jboss.naming:" + scopedBeanName;
builder.addConstructorParameter(JavaEEComponent.class.getName(), new AbstractInjectionValueMetaData(componentBeanName));
// TODO: is deployment always available at this stage?
deployment.getBeanFactories().add(builder.getBeanMetaDataFactory());
}
// modify the container bean meta data to inject the EjbEncFactory
BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder(bean);
//builder.addPropertyMetaData("namingComponent", new AbstractInjectionValueMetaData("java:comp"));
builder.addPropertyMetaData("ejbEncFactory", new AbstractInjectionValueMetaData(encFactoryBeanName));
// Add the BeanInstantiator injection into EJBContainer
// TODO: (Jaikiran) Terrible hack! Use JavaEEComponentInformer to get the app name.
// But for now, due to lack of time for 6.0.0.CR1 release, let's just use this hack
if (appName == null)
{
appName = moduleName;
}
String beanInstantiatorMcName = BeanInstantiatorRegistration.getInstantiatorRegistrationName(appName, moduleName, container.getEjbName());
builder.addPropertyMetaData("beanInstantiator", new AbstractInjectionValueMetaData(beanInstantiatorMcName));
// ahem
if(service instanceof StatelessContainer)
{