// get the module description
final EEModuleDescription moduleDescription = deploymentUnit.getAttachment(org.jboss.as.ee.component.Attachments.EE_MODULE_DESCRIPTION);
final String applicationName = moduleDescription.getApplicationName();
final String beanName = sessionBean.getName();
final SessionBeanComponentDescription sessionBeanDescription = (SessionBeanComponentDescription) moduleDescription.getComponentByName(beanName);
sessionBeanDescription.setDeploymentDescriptorEnvironment(new DeploymentDescriptorEnvironment("java:comp/env/", sessionBean));
// mapped-name
sessionBeanDescription.setMappedName(sessionBean.getMappedName());
// local business interface views
BusinessLocalsMetaData businessLocals = sessionBean.getBusinessLocals();
if (businessLocals != null && !businessLocals.isEmpty()) {
sessionBeanDescription.addLocalBusinessInterfaceViews(businessLocals);
}
// remote business interface views
BusinessRemotesMetaData businessRemotes = sessionBean.getBusinessRemotes();
if (businessRemotes != null && !businessRemotes.isEmpty()) {
sessionBeanDescription.addRemoteBusinessInterfaceViews(businessRemotes);
}
// tx management type
if (sessionBean.getTransactionType() != null) {
sessionBeanDescription.setTransactionManagementType(sessionBean.getTransactionType());
}
// CMT Tx attributes
if (sessionBean.getTransactionType() != TransactionManagementType.BEAN) {
ContainerTransactionsMetaData containerTransactions = sessionBean.getContainerTransactions();
if (containerTransactions != null && !containerTransactions.isEmpty()) {
final String className = null; // applies to any class
for (ContainerTransactionMetaData containerTx : containerTransactions) {
TransactionAttributeType txAttr = containerTx.getTransAttribute();
MethodsMetaData methods = containerTx.getMethods();
for (MethodMetaData method : methods) {
String methodName = method.getMethodName();
MethodIntf methodIntf = this.getMethodIntf(method.getMethodIntf());
if (methodName.equals("*")) {
sessionBeanDescription.setTransactionAttribute(methodIntf, className, txAttr);
} else {
MethodParametersMetaData methodParams = method.getMethodParams();
// update the session bean description with the tx attribute info
sessionBeanDescription.setTransactionAttribute(methodIntf, txAttr, className, methodName, this.getMethodParams(methodParams));
}
}
}
}
}