use of org.apache.openejb.jee.RemoteBean in project tomee by apache.
the class CheckClasses method validate.
public void validate(final EjbModule ejbModule) {
final ClassLoader loader = ejbModule.getClassLoader();
for (final EnterpriseBean bean : ejbModule.getEjbJar().getEnterpriseBeans()) {
try {
final Class<?> beanClass = check_hasEjbClass(loader, bean);
// All the subsequent checks require the bean class
if (beanClass == null) {
continue;
}
if (!(bean instanceof RemoteBean)) {
continue;
}
if (bean instanceof SessionBean && ((SessionBean) bean).getProxy() != null) {
continue;
}
final RemoteBean b = (RemoteBean) bean;
check_isEjbClass(b);
check_hasDependentClasses(b, b.getEjbClass(), "ejb-class");
check_hasInterface(b);
if (b.getRemote() != null) {
checkInterface(loader, b, beanClass, "remote", b.getRemote());
}
if (b.getHome() != null) {
checkInterface(loader, b, beanClass, "home", b.getHome());
}
if (b.getLocal() != null) {
checkInterface(loader, b, beanClass, "local", b.getLocal());
}
if (b.getLocalHome() != null) {
checkInterface(loader, b, beanClass, "local-home", b.getLocalHome());
}
if (b instanceof SessionBean) {
final SessionBean sessionBean = (SessionBean) b;
for (final String interfce : sessionBean.getBusinessLocal()) {
checkInterface(loader, b, beanClass, "business-local", interfce);
}
for (final String interfce : sessionBean.getBusinessRemote()) {
checkInterface(loader, b, beanClass, "business-remote", interfce);
}
}
} catch (final RuntimeException e) {
throw new OpenEJBRuntimeException(bean.getEjbName(), e);
}
}
for (final Interceptor interceptor : ejbModule.getEjbJar().getInterceptors()) {
check_hasInterceptorClass(loader, interceptor);
}
}
use of org.apache.openejb.jee.RemoteBean in project tomee by apache.
the class EjbJarInfoBuilder method resolveRoleLinks.
private void resolveRoleLinks(final EnterpriseBeanInfo bean, final JndiConsumer item) {
if (!(item instanceof RemoteBean)) {
return;
}
final RemoteBean rb = (RemoteBean) item;
final List<SecurityRoleRef> refs = rb.getSecurityRoleRef();
for (final SecurityRoleRef ref : refs) {
final SecurityRoleReferenceInfo info = new SecurityRoleReferenceInfo();
info.description = ref.getDescription();
info.roleLink = ref.getRoleLink();
info.roleName = ref.getRoleName();
if (info.roleLink == null) {
info.roleLink = info.roleName;
}
bean.securityRoleReferences.add(info);
}
}
use of org.apache.openejb.jee.RemoteBean in project tomee by apache.
the class CheckMethods method validate.
public void validate(final EjbModule ejbModule) {
for (final EnterpriseBean bean : ejbModule.getEjbJar().getEnterpriseBeans()) {
if (!(bean instanceof RemoteBean)) {
continue;
}
final RemoteBean b = (RemoteBean) bean;
if (b.getHome() != null) {
check_remoteInterfaceMethods(b);
check_homeInterfaceMethods(b);
}
if (b.getLocalHome() != null) {
check_localInterfaceMethods(b);
check_localHomeInterfaceMethods(b);
}
check_unusedCreateMethods(b);
check_unusedPostCreateMethods(b);
}
}
Aggregations