String sessionBeanTypeName = "jboss.ejb3:";
if(appName != null)
sessionBeanTypeName += "application=" + appName + ",";
sessionBeanTypeName += "module=" + moduleName + ",component=" + componentName + ",service=" + SessionBeanTypeWrapper.class.getSimpleName();
{
BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder(sessionBeanTypeName, SessionBeanTypeWrapper.class.getName());
builder.addConstructorParameter(JBossSessionBeanMetaData.class.getName(), sessionBeanMetaData);
builder.addConstructorParameter(ClassLoader.class.getName(), unit.getClassLoader());
builder.addConstructorParameter(JavaEEComponent.class.getName(), builder.createInject(javaCompName));
unit.getParent().addAttachment(sessionBeanTypeName, builder.getBeanMetaData());
}
String beanInstanceName = "jboss.ejb3:";
if (appName != null)
beanInstanceName += "application=" + appName + ",";
beanInstanceName += "module=" + moduleName + ",component=" + componentName + ",service=" + EJBBinder.class.getSimpleName();
BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder(beanInstanceName, EJBBinder.class.getName());
builder.addConstructorParameter(SessionBeanType.class.getName(), builder.createInject(sessionBeanTypeName));
builder.addPropertyMetaData("globalContext", builder.createInject("NameSpaces", "globalContext"));
builder.addPropertyMetaData("proxyFactory", legacy);
builder.setStart("bind");
builder.setStop("unbind");
for (DependencyBuilder db : builders)
db.buildDependency(unit, builder);
unit.getParent().addAttachment(beanInstanceName, builder.getBeanMetaData());
}