if (isEntityBean(javaClass)) {
tags = javaClass.getTagsByName(TagLibrary.EJB_FINDER);
// Let dig into class level ejb.finder tags
for (int i = 0; i < tags.length; i++) {
EjbFinderTag finderTag = (EjbFinderTag) tags[i];
int permType = getViewType(finderTag.getViewType()) & (REMOTE_HOME | LOCAL_HOME);
// -------------------------------------------------------
// Let's "bitwise and" to get only the specied masks
// that are compatible with the bean
// HUMM: Is this valid ?
if (finderTag.getMethodIntf() != null) {
permType &= getInterfaceType(finderTag.getMethodIntf());
}
if (permType == 0) {
throw getErrorWithTagLocation(finderTag,
"Couldn't resolve a compatible interface type reference. Maybe bean/view-type/version doesn't support it!");
}
// -------------------------------------------------------
// We are generating an method permission if there is at least
// one role or unchecked is true
// NOTE: unchecked is only valid for EJB 2.0+
boolean canContinue = (finderTag.getRoleNames() != null && finderTag.getRoleNames().length > 0);
if (version.greaterOrEquals(EjbVersion.EJB_2_0)) {
canContinue |= finderTag.isUnchecked();
}
if (canContinue) {
// Lets expand by permission for interface type
// Method signature should maybe be unrolled by permType, but it's not really relevant
// the return type, soo..
retLst.addAll(MethodPermission.unroll(permType, getFinderMethodBySignature(finderTag.getSignature()),
finderTag.getRoleNames()));
}
}
EjbPkTag pkTag = (EjbPkTag) javaClass.getTagByName(TagLibrary.EJB_PK);