// Let dig into class level ejb.transaction tags
tags = javaClass.getTagsByName(TagLibrary.EJB_TRANSACTION);
for (int i = 0; i < tags.length; i++) {
EjbTransactionTag transTag = (EjbTransactionTag) tags[i];
int permType = 0;
//int permType = getViewType(javaClass);
// -------------------------------------------------------
// Let's "bitwise and" to get only the specied masks
// that are compatible with the bean
// HUMM: Is this valid ?
if (transTag.getMethodIntf() != null) {
permType = getViewType(javaClass);
permType &= getInterfaceType(transTag.getMethodIntf());
if (permType == 0) {
throw getErrorWithTagLocation(transTag,
"Couldn't resolve a compatible interface type reference. Maybe bean/view-type/version doesn't support it!");
}
// Lets expand by permission for interface type
// Only one entry should be present
retLst.addAll(ContainerTransaction.unroll(permType, transTag.getType()));
} else {
// No permission was set
retLst.add(new ContainerTransaction(transTag.getType()));
}
// if (permType == 0) {
// throw getErrorWithTagLocation(transTag,
// "Couldn't resolve a compatible interface type reference. Maybe bean/view-type/version doesn't support it!");
// }
// Lets expand by permission for interface type
// retLst.addAll(ContainerTransaction.unroll(permType, transTag.getType()));
}
// Now let's dig into method level ejb.transaction tags
JavaMethod[] methods = javaClass.getMethods();
JavaMethod method;
for (int j = 0; j < methods.length; j++) {
tags = (method = methods[j]).getTagsByName(TagLibrary.EJB_TRANSACTION_METHOD);
for (int k = 0; k < tags.length; k++) {
EjbTransactionMethodTag transTag = (EjbTransactionMethodTag) tags[k];
int methodType = getMethodType(method);
if ((methodType != IFACE_METHOD_CREATE) && (methodType != IFACE_METHOD_COMPONENT)) {
throw getErrorWithTagLocation(transTag,
"Can't mark a method transaction on a non interface or create method");
}
int permType = getViewType(method, javaClass);
// -------------------------------------------------------
// Let's "bitwise and" to get only the specied masks
// that are compatible with the bean
// HUMM: Is this valid ?
if (permType == 0) {
throw getErrorWithTagLocation(transTag,
"Couldn't resolve a compatible interface type reference. Maybe bean/view-type/version doesn't support it!");
}
// Lets expand by permission for interface type
retLst.addAll(ContainerTransaction.unroll(permType, externalizeMethodName(method), transTag.getType()));
}
}
if (isEntityBean(javaClass)) {
tags = javaClass.getTagsByName(TagLibrary.EJB_FINDER);