Package org.jboss.metadata.ejb.spec

Examples of org.jboss.metadata.ejb.spec.MethodsMetaData


      // Process the method-permission MethodMetaData
      MethodPermissionsMetaData perms = bean.getMethodPermissions();
      if (perms != null)
         for (MethodPermissionMetaData perm : perms)
         {
            MethodsMetaData methods = perm.getMethods();
            if (methods != null)
               for (org.jboss.metadata.ejb.spec.MethodMetaData mmd : methods)
               {
                  String[] params =
                  {};
                  if (mmd.getMethodParams() != null)
                     params = mmd.getMethodParams().toArray(params);
                  else
                     params = null;
                  String methodName = mmd.getMethodName();
                  if (methodName != null && methodName.equals("*"))
                     methodName = null;
                  MethodInterfaceType miType = mmd.getMethodIntf();
                  String iface = miType != null ? miType.name() : null;
                  EJBMethodPermission p = new EJBMethodPermission(mmd.getEjbName(), methodName, iface, params);
                  if (perm.getUnchecked() != null)
                  {
                     pc.addToUncheckedPolicy(p);
                  }
                  else
                  {
                     Set<String> roles = perm.getRoles();
                     Iterator riter = roles.iterator();
                     while (riter.hasNext())
                     {
                        String role = (String) riter.next();
                        pc.addToRole(role, p);
                     }
                  }
               }
         }

      // Process the exclude-list MethodMetaData
      ExcludeListMetaData excluded = bean.getExcludeList();
      if (excluded != null)
      {
         MethodsMetaData methods = excluded.getMethods();
         if (methods != null)
            for (org.jboss.metadata.ejb.spec.MethodMetaData mmd : methods)
            {
               String[] params =
               {};
View Full Code Here


   public ExcludedMethodMetaDataIterator(ExcludeListMetaData excluded)
   {
      if (excluded == null)
         return;
      this.excludeList = excluded;
      MethodsMetaData methods = excluded.getMethods();
      if (methods == null)
         return;
      delegate = methods.iterator();
   }
View Full Code Here

  
   protected abstract ContainerTransactionMetaData createContainerTransaction(String ejbName, TransactionAttribute annotation, E element);
  
   protected MethodsMetaData createMethods(String ejbName, Method method)
   {
      MethodsMetaData methods = new MethodsMetaData();
      methods.add(ProcessorUtils.createMethod(ejbName, method));
      return methods;
   }
View Full Code Here

         method = (Method) type;

      String ejbName = EjbNameThreadLocal.ejbName.get();
      MethodMetaData mmd = ProcessorUtils.createMethod(ejbName, method);
      MethodPermissionMetaData perm = new MethodPermissionMetaData();
      MethodsMetaData methods = perm.getMethods();
      if(methods == null)
      {
         methods = new MethodsMetaData();
         perm.setMethods(methods);
      }
      HashSet<String> roles = new HashSet<String>();
      for(String role : allowed.value())
         roles.add(role);
      perm.setRoles(roles);
      Descriptions descriptions = ProcessorUtils.getDescription("@RolesAllowed for: "+type);
      mmd.setDescriptions(descriptions);
      methods.add(mmd);
      metaData.add(perm);
   }
View Full Code Here

   {
      DenyAll deny = finder.getAnnotation(method, DenyAll.class);
      if(deny == null)
         return;

      MethodsMetaData methods = metaData.getMethods();
      if(methods == null)
      {
         methods = new MethodsMetaData();
         metaData.setMethods(methods);
      }
      String ejbName = EjbNameThreadLocal.ejbName.get();
      if(ejbName == null)
         ejbName = "*";
      MethodMetaData mmd = ProcessorUtils.createMethod(ejbName, method);
      Descriptions descriptions = ProcessorUtils.getDescription("@DenyAll for: "+method);
      mmd.setDescriptions(descriptions);
      log.trace("add " + mmd);
      methods.add(mmd);
   }
View Full Code Here

         method = (Method) type;

      String ejbName = EjbNameThreadLocal.ejbName.get();
      MethodMetaData mmd = ProcessorUtils.createMethod(ejbName, method);
      MethodPermissionMetaData perm = new MethodPermissionMetaData();
      MethodsMetaData methods = perm.getMethods();
      if(methods == null)
      {
         methods = new MethodsMetaData();
         perm.setMethods(methods);
      }
      perm.setUnchecked(new EmptyMetaData());
      Descriptions descriptions = ProcessorUtils.getDescription("@PermitAll for: "+type);
      mmd.setDescriptions(descriptions);
      methods.add(mmd);
      metaData.add(perm);
   }
View Full Code Here

   private void bump()
   {
      while (delegate.hasNext())
      {
         permission = delegate.next();
         MethodsMetaData theMethods = permission.getMethods();
         if (theMethods != null && theMethods.isEmpty() == false)
         {
            methods = theMethods.iterator();
            break;
         }
      }
   }
View Full Code Here

   private void bump()
   {
      while (delegate.hasNext())
      {
         transaction = delegate.next();
         MethodsMetaData theMethods = transaction.getMethods();
         if (theMethods != null && theMethods.isEmpty() == false)
         {
            methods = theMethods.iterator();
            break;
         }
      }
   }
View Full Code Here

      }
      for (ContainerTransactionMetaData transactionMetaData : containerTransactions)
      {
         TransactionAttributeType txAttributeType = transactionMetaData.getTransAttribute();

         MethodsMetaData methods = transactionMetaData.getMethods();
         if (methods == null || methods.isEmpty())
         {
            continue;
         }
         for (MethodMetaData methodMetaData : methods)
         {
View Full Code Here

                //now handle method permissions
                final MethodPermissionsMetaData methodPermissions = assemblyDescriptor.getMethodPermissionsByEjbName(componentConfiguration.getEJBName());
                if (methodPermissions != null) {
                    for (final MethodPermissionMetaData methodPermissionMetaData : methodPermissions) {

                        final MethodsMetaData methods = methodPermissionMetaData.getMethods();
                        for (final MethodMetaData method : methods) {
                            EJBMethodSecurityAttribute ejbMethodSecurityMetaData;
                            // EJB 3.1 FR 17.3.2.2 The unchecked element is used instead of a role name in the method-permission element to indicate that all roles are permitted.
                            if (methodPermissionMetaData.isNotChecked()) {
                                ejbMethodSecurityMetaData = EJBMethodSecurityAttribute.permitAll();
View Full Code Here

TOP

Related Classes of org.jboss.metadata.ejb.spec.MethodsMetaData

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.