Examples of DeclareRolesProcessor


Examples of org.jboss.metadata.annotation.creator.DeclareRolesProcessor

      addTypeProcessor(new TransactionAttributeClassProcessor<MD>(finder));
      addMethodProcessor(new TransactionAttributeMethodProcessor<MD>(finder));
      // @RunAs
      addTypeProcessor(new RunAsProcessor(finder));
      // @DeclareRoles
      addTypeProcessor(new DeclareRolesProcessor(finder));
      // @DenyAll
      addMethodProcessor(new DenyAllProcessor(finder));
      // @RolesAllowed
      addTypeProcessor(new RolesAllowedProcessor<Class>(finder));
      addMethodProcessor(new RolesAllowedProcessor<Method>(finder));
View Full Code Here

Examples of org.jboss.metadata.annotation.creator.DeclareRolesProcessor

/*  60 */     addTypeProcessor(new TransactionAttributeClassProcessor(finder));
/*  61 */     addMethodProcessor(new TransactionAttributeMethodProcessor(finder));
/*     */
/*  63 */     addTypeProcessor(new RunAsProcessor(finder));
/*     */
/*  65 */     addTypeProcessor(new DeclareRolesProcessor(finder));
/*     */
/*  67 */     addMethodProcessor(new DenyAllProcessor(finder));
/*     */
/*  69 */     addTypeProcessor(new RolesAllowedProcessor(finder));
/*  70 */     addMethodProcessor(new RolesAllowedProcessor(finder));
View Full Code Here

Examples of org.jboss.metadata.annotation.creator.DeclareRolesProcessor

/*    */   {
/* 47 */     super(finder);
/*    */
/* 49 */     addTypeProcessor(new RunAsProcessor(finder));
/*    */
/* 51 */     addTypeProcessor(new DeclareRolesProcessor(finder));
/*    */   }
View Full Code Here

Examples of org.jboss.metadata.annotation.creator.DeclareRolesProcessor

      // @WebServlet
      addTypeProcessor(new WebServletProcessor(finder));
      // @RunAs
      addTypeProcessor(new RunAsProcessor(finder));
      // @DeclareRoles
      addTypeProcessor(new DeclareRolesProcessor(finder));
      // @MultipartConfig
      addTypeProcessor(new MultipartConfigProcessor(finder));
      // @ServletSecurity
      addTypeProcessor(new ServletSecurityProcessor(finder));
   }
View Full Code Here

Examples of org.jboss.metadata.annotation.creator.DeclareRolesProcessor

            }
        }
        // @DeclareRoles
        final List<AnnotationTarget> declareRolesAnnotationTargets = index.getAnnotationTargets(declareRoles);
        if (declareRolesAnnotationTargets != null && declareRolesAnnotationTargets.size() > 0) {
            DeclareRolesProcessor processor = new DeclareRolesProcessor(finder);
            SecurityRolesMetaData securityRoles = metaData.getSecurityRoles();
            if (securityRoles == null) {
               securityRoles = new SecurityRolesMetaData();
               metaData.setSecurityRoles(securityRoles);
            }
            for (final AnnotationTarget target : declareRolesAnnotationTargets) {
                if (!(target instanceof ClassInfo)) {
                    throw new DeploymentUnitProcessingException("@DeclareRoles is only allowed at class level " + target);
                }
                ClassInfo classInfo = ClassInfo.class.cast(target);
                Class<?> type = null;
                try {
                    type = classLoader.loadClass(classInfo.name().toString());
                } catch (Exception e) {
                    throw new DeploymentUnitProcessingException("Could not process @DeclareRoles on " + target);
                }
                if (type != null) {
                    processor.process(securityRoles, type);
                }
            }
        }
        // @MultipartConfig
        final List<AnnotationTarget> multipartConfigAnnotationTargets = index.getAnnotationTargets(multipartConfig);
        if (multipartConfigAnnotationTargets != null && multipartConfigAnnotationTargets.size() > 0) {
            MultipartConfigProcessor processor = new MultipartConfigProcessor(finder);
            AnnotationsMetaData annotations = metaData.getAnnotations();
            if (annotations == null) {
               annotations = new AnnotationsMetaData();
               metaData.setAnnotations(annotations);
            }
            for (final AnnotationTarget target : multipartConfigAnnotationTargets) {
                if (!(target instanceof ClassInfo)) {
                    throw new DeploymentUnitProcessingException("@MultipartConfig is only allowed at class level " + target);
                }
                ClassInfo classInfo = ClassInfo.class.cast(target);
                Class<?> type = null;
                try {
                    type = classLoader.loadClass(classInfo.name().toString());
                } catch (Exception e) {
                    throw new DeploymentUnitProcessingException("Could not process @MultipartConfig on " + target);
                }
                if (type != null) {
                    processor.process(annotations, type);
                }
            }
        }
        // @ServletSecurity
        final List<AnnotationTarget> servletSecurityAnnotationTargets = index.getAnnotationTargets(servletSecurity);
        if (servletSecurityAnnotationTargets != null && servletSecurityAnnotationTargets.size() > 0) {
            ServletSecurityProcessor processor = new ServletSecurityProcessor(finder);
            AnnotationsMetaData annotations = metaData.getAnnotations();
            if (annotations == null) {
               annotations = new AnnotationsMetaData();
               metaData.setAnnotations(annotations);
            }
            for (final AnnotationTarget target : servletSecurityAnnotationTargets) {
                if (!(target instanceof ClassInfo)) {
                    throw new DeploymentUnitProcessingException("@ServletSecurity is only allowed at class level " + target);
                }
                ClassInfo classInfo = ClassInfo.class.cast(target);
                Class<?> type = null;
                try {
                    type = classLoader.loadClass(classInfo.name().toString());
                } catch (Exception e) {
                    throw new DeploymentUnitProcessingException("Could not process @ServletSecurity on " + target);
                }
                if (type != null) {
                    processor.process(annotations, type);
                }
            }
        }
        return metaData;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.