if (enterpriseBean != null)
{
TransactionManagementType transactionType = enterpriseBean.getTransactionType();
if (transactionType != null)
{
TransactionManagementImpl annotation = new TransactionManagementImpl();
annotation.setValue(transactionType);
addClassAnnotation(container, TransactionManagement.class, annotation);
}
MethodAttributesMetaData attributes = enterpriseBean.getMethodAttributes();
if (attributes != null)
{
for(MethodAttributeMetaData method : attributes)
{
TransactionTimeout timeoutAnnotation = new TransactionTimeoutImpl(method.getTransactionTimeout());
addAnnotations(TransactionTimeout.class, timeoutAnnotation, container, method.getMethodName(), null);
}
}
}
JBossAssemblyDescriptorMetaData descriptor = dd.getAssemblyDescriptor();
if (descriptor != null && descriptor.getContainerTransactions() != null)
{
for(ContainerTransactionMetaData transaction : descriptor.getContainerTransactions())
{
for(MethodMetaData method : transaction.getMethods())
{
if (method.getEjbName().equals(ejbName))
{
TransactionAttributeImpl annotation = new TransactionAttributeImpl();
annotation.setType(transaction.getTransAttribute());
addAnnotations(TransactionAttribute.class, annotation, container, method);
}
}
}
}