Package javax.annotation.security

Examples of javax.annotation.security.RunAs


/* 48 */     super(finder);
/*    */   }
/*    */
/*    */   public void process(ServletsMetaData metaData, Class type)
/*    */   {
/* 53 */     RunAs annotation = (RunAs)this.finder.getAnnotation(type, RunAs.class);
/* 54 */     if (annotation == null) {
/* 55 */       return;
/*    */     }
/* 57 */     RunAsMetaData runAs = super.create(type);
/* 58 */     ServletMetaData servlet = new ServletMetaData();
View Full Code Here


/*     */ {
/*  53 */   private static final Logger log = Logger.getLogger(RunAsSecurityInterceptorFactory.class);
/*     */
/*     */   protected RunAsIdentity getRunAsIdentity(EJBContainer container)
/*     */   {
/*  57 */     RunAs runAs = (RunAs)container.resolveAnnotation(RunAs.class);
/*  58 */     if (runAs == null) {
/*  59 */       return null;
/*     */     }
/*  61 */     String runAsPrincipal = runAs.value();
/*  62 */     Set extraRoles = new HashSet();
/*     */
/*  64 */     JBossAssemblyDescriptorMetaData ad = container.getAssemblyDescriptor();
/*  65 */     if ((ad != null) && (runAsPrincipal != null))
/*     */     {
/*  67 */       extraRoles.addAll(ad.getSecurityRoleNamesByPrincipal(runAsPrincipal));
/*     */     }
/*     */
/*  70 */     return new RunAsIdentity(runAs.value(), runAsPrincipal, extraRoles);
/*     */   }
View Full Code Here

                /* Process RunAs annotation which can be only on servlets.
                 * Ref JSR 250, equivalent to the run-as element in
                 * the deployment descriptor
                 */
                if (classClass.isAnnotationPresent(RunAs.class)) {
                    RunAs annotation = (RunAs)
                        classClass.getAnnotation(RunAs.class);
                    wrapper.setRunAs(annotation.value());
                }
            }
        }
       
       
View Full Code Here

            }
            final MultipartConfig multipartConfig = servletInfo.getServletClass().getAnnotation(MultipartConfig.class);
            if (multipartConfig != null) {
                servletInfo.setMultipartConfig(new MultipartConfigElement(multipartConfig.location(), multipartConfig.maxFileSize(), multipartConfig.maxRequestSize(), multipartConfig.fileSizeThreshold()));
            }
            final RunAs runAs = servletInfo.getServletClass().getAnnotation(RunAs.class);
            if (runAs != null) {
                servletInfo.setRunAs(runAs.value());
            }
            final DeclareRoles declareRoles = servletInfo.getServletClass().getAnnotation(DeclareRoles.class);
            if (declareRoles != null) {
                deploymentInfo.addSecurityRoles(declareRoles.value());
            }
View Full Code Here

        List<Class> classesWithRunAs = classFinder.findAnnotatedClasses(RunAs.class);

        // Class-level annotation
        for (Class cls : classesWithRunAs) {
            RunAs runAs = (RunAs) cls.getAnnotation(RunAs.class);
            if (runAs != null && Servlet.class.isAssignableFrom(cls)) {
                addRunAs(webApp, runAs, cls);
            }
        }
View Full Code Here

            }
            final MultipartConfig multipartConfig = servletInfo.getServletClass().getAnnotation(MultipartConfig.class);
            if (multipartConfig != null) {
                servletInfo.setMultipartConfig(new MultipartConfigElement(multipartConfig.location(), multipartConfig.maxFileSize(), multipartConfig.maxRequestSize(), multipartConfig.fileSizeThreshold()));
            }
            final RunAs runAs = servletInfo.getServletClass().getAnnotation(RunAs.class);
            if (runAs != null) {
                servletInfo.setRunAs(runAs.value());
            }
            final DeclareRoles declareRoles = servletInfo.getServletClass().getAnnotation(DeclareRoles.class);
            if (declareRoles != null) {
                deploymentInfo.addSecurityRoles(declareRoles.value());
            }
View Full Code Here

                }

                /*
                 * @RunAs
                 */
                RunAs runAs = clazz.getAnnotation(RunAs.class);
                if (runAs != null && bean.getSecurityIdentity() == null) {
                    SecurityIdentity securityIdentity = new SecurityIdentity();
                    securityIdentity.setRunAs(runAs.value());
                    bean.setSecurityIdentity(securityIdentity);
                }

                /*
                 * @DeclareRoles
 
View Full Code Here

      super(finder);
   }

   public void process(AnnotationsMetaData metaData, Class<?> type)
   {
      RunAs annotation = finder.getAnnotation(type, RunAs.class);
      if(annotation == null)
         return;

      RunAsMetaData runAs = super.create(type);
      AnnotationMetaData annotationMD = metaData.get(type.getName());
View Full Code Here

        // Process RunAs
        if (wcd.getRunAsIdentity() == null) {
            String roleName = runAsRoleName;
            if (roleName == null && clazz.isAnnotationPresent(RunAs.class)) {
                RunAs runAs = (RunAs)clazz.getAnnotation(RunAs.class);
                roleName = runAs.value();
            }
            if (roleName != null) {
                super.setRunAsRole(roleName);

                wbd.addRole(new Role(roleName));
View Full Code Here

                /* Process RunAs annotation which can be only on servlets.
                 * Ref JSR 250, equivalent to the run-as element in
                 * the deployment descriptor
                 */
                RunAs annotation = classClass.getAnnotation(RunAs.class);
                if (annotation != null) {
                    wrapper.setRunAs(annotation.value());
                }
            }
        }

    }
View Full Code Here

TOP

Related Classes of javax.annotation.security.RunAs

Copyright © 2018 www.massapicom. 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.