/** * Searches for an annotation starting at the specified class and working backwards. * Searching stops when the annotation is found. * * @param clazz * @param annotationClass * @return */ private <A extends Annotation> A getInheritableAnnotation(final Class clazz, final Class<A> annotationClass) { if (clazz == null || clazz.equals(Object.class)) { return null; } final MetaAnnotatedClass meta = new MetaAnnotatedClass(clazz); final Annotation annotation = meta.getAnnotation(annotationClass); if (annotation != null) { return (A) annotation; } return getInheritableAnnotation(clazz.getSuperclass(), annotationClass); }
/** * Searches for an annotation starting at the specified class and working backwards. * Searching stops when the annotation is found. * * @param clazz * @param annotationClass * @return */ private <A extends Annotation> A getInheritableAnnotation(final Class clazz, final Class<A> annotationClass) { if (clazz == null || clazz.equals(Object.class)) { return null; } final MetaAnnotatedClass meta = new MetaAnnotatedClass(clazz); final Annotation annotation = meta.getAnnotation(annotationClass); if (annotation != null) { return (A) annotation; } return getInheritableAnnotation(clazz.getSuperclass(), annotationClass); }
if (ejbClass.isInterface()) { // dynamic proxy implementation bean.setLocal(ejbClass.getName()); final Proxy proxyAnnotation = (Proxy) new MetaAnnotatedClass(ejbClass).getAnnotation(Proxy.class); if (proxyAnnotation != null) { proxyClass = proxyAnnotation.value();
if (ejbClass.isInterface()) { // dynamic proxy implementation bean.setLocal(ejbClass.getName()); final Proxy proxyAnnotation = (Proxy) new MetaAnnotatedClass(ejbClass).getAnnotation(Proxy.class); if (proxyAnnotation != null) { proxyClass = proxyAnnotation.value();
final RolesAllowed rolesAllowed = clazz.getAnnotation(RolesAllowed.class); final PermitAll permitAll = clazz.getAnnotation(PermitAll.class); final DenyAll denyAll = clazz.getAnnotation(DenyAll.class); final RunAs runAs = clazz.getAnnotation(RunAs.class); if (runAs != null && bean.getSecurityIdentity() == null) { final SecurityIdentity securityIdentity = new SecurityIdentity(); final DeclareRoles declareRoles = clazz.getAnnotation(DeclareRoles.class); if (declareRoles != null && bean instanceof RemoteBean) { final RemoteBean remoteBean = (RemoteBean) bean;
final RolesAllowed rolesAllowed = clazz.getAnnotation(RolesAllowed.class); final PermitAll permitAll = clazz.getAnnotation(PermitAll.class); final DenyAll denyAll = clazz.getAnnotation(DenyAll.class); final RunAs runAs = clazz.getAnnotation(RunAs.class); if (runAs != null && bean.getSecurityIdentity() == null) { final SecurityIdentity securityIdentity = new SecurityIdentity(); final DeclareRoles declareRoles = clazz.getAnnotation(DeclareRoles.class); if (declareRoles != null && bean instanceof RemoteBean) { final RemoteBean remoteBean = (RemoteBean) bean;
ancestors.addAll(asList(clazz.getInterfaces())); if (dynamicBean) { final Proxy p = metaClass.getAnnotation(Proxy.class); if (p != null) { ancestors.add(p.value()); } else { final Class<?>[] classes; final Proxy proxy = metaClass.getAnnotation(Proxy.class); if (proxy == null) { classes = new Class<?>[]{clazz};
ancestors.addAll(asList(clazz.getInterfaces())); if (dynamicBean) { final Proxy p = metaClass.getAnnotation(Proxy.class); if (p != null) { ancestors.add(p.value()); } else { final Class<?>[] classes; final Proxy proxy = metaClass.getAnnotation(Proxy.class); if (proxy == null) { classes = new Class<?>[]{clazz};