Package org.jboss.metadata.ejb.spec

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


      return methodMetaData;
   }

   public static MethodParametersMetaData getMethodParameters(Method method)
   {
      MethodParametersMetaData metaData = new MethodParametersMetaData();
      for(Class<?> parameterType : method.getParameterTypes())
      {
         metaData.add(parameterType.getName());
      }
      return metaData;
   }
View Full Code Here


      NamedMethodMetaData beanMethod = new NamedMethodMetaData();
      beanMethod.setMethodName(method.getName());
      metaData.setBeanMethod(beanMethod);
      metaData.setRetainIfException(remove.retainIfException());

      MethodParametersMetaData methodParams = ProcessorUtils.getMethodParameters(method);
      beanMethod.setMethodParams(methodParams);
     
      return metaData;
   }
View Full Code Here

            continue;
         }
         for (MethodMetaData methodMetaData : methods)
         {
            String methodName = methodMetaData.getMethodName();
            MethodParametersMetaData methodParams = methodMetaData.getMethodParams();
            String[] params = null;
            if (methodParams != null)
            {
               params = methodParams.toArray(params);
            }
            MethodInterfaceType methodIntf = methodMetaData.getMethodIntf();
            try
            {
               if (methodIntf != null)
View Full Code Here

            final InitMethodsMetaData inits = metaData.getInitMethods();
            if (inits != null) {
                for (InitMethodMetaData method : inits) {
                    Method beanMethod = MethodResolutionUtils.resolveMethod(method.getBeanMethod(), componentClass, deploymentReflectionIndex);
                    if (method.getCreateMethod() != null) {
                        MethodParametersMetaData p = method.getCreateMethod().getMethodParams();
                        description.addInitMethod(beanMethod, method.getCreateMethod().getMethodName());
                    } else {
                        description.addInitMethod(beanMethod, null);
                    }
                }
View Full Code Here

                        final MethodIntf methodIntf = this.getMethodIntf(method.getMethodIntf());
                        if (methodName.equals("*")) {
                            componentConfiguration.getDescriptorMethodPermissions().setAttribute(methodIntf, null, EJBMethodSecurityAttribute.denyAll());
                        } else {

                            final MethodParametersMetaData methodParams = method.getMethodParams();
                            // update the session bean description with the tx attribute info
                            if (methodParams == null) {
                                componentConfiguration.getDescriptorMethodPermissions().setAttribute(methodIntf, EJBMethodSecurityAttribute.denyAll(), methodName);
                            } else {

                                componentConfiguration.getDescriptorMethodPermissions().setAttribute(methodIntf, EJBMethodSecurityAttribute.denyAll(), null, methodName, this.getMethodParams(methodParams));
                            }
                        }
                    }
                }

                //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();
                            } else {
                                ejbMethodSecurityMetaData = EJBMethodSecurityAttribute.rolesAllowed(methodPermissionMetaData.getRoles());
                            }
                            final String methodName = method.getMethodName();
                            final MethodIntf methodIntf = this.getMethodIntf(method.getMethodIntf());
                            if (methodName.equals("*")) {
                                final EJBMethodSecurityAttribute existingRoles = componentConfiguration.getDescriptorMethodPermissions().getAttributeStyle1(methodIntf, null);
                                ejbMethodSecurityMetaData = mergeExistingRoles(ejbMethodSecurityMetaData, existingRoles);
                                componentConfiguration.getDescriptorMethodPermissions().setAttribute(methodIntf, null, ejbMethodSecurityMetaData);
                            } else {

                                final MethodParametersMetaData methodParams = method.getMethodParams();
                                // update the session bean description with the tx attribute info
                                if (methodParams == null) {

                                    final EJBMethodSecurityAttribute existingRoles = componentConfiguration.getDescriptorMethodPermissions().getAttributeStyle2(methodIntf, methodName);
                                    ejbMethodSecurityMetaData = mergeExistingRoles(ejbMethodSecurityMetaData, existingRoles);
View Full Code Here

                                    componentConfiguration.getTransactionAttributes().setAttribute(methodIntf, null, txAttr);
                                if (timeout != null)
                                    componentConfiguration.getTransactionTimeouts().setAttribute(methodIntf, null, timeout);
                            } else {

                                final MethodParametersMetaData methodParams = method.getMethodParams();
                                // update the session bean description with the tx attribute info
                                if (methodParams == null) {
                                    if (txAttr != null)
                                        componentConfiguration.getTransactionAttributes().setAttribute(methodIntf, txAttr, methodName);
                                    if (timeout != null)
View Full Code Here

         if(timeoutMethodMetaData != null)
         {
            // timeout method name
            methodName = timeoutMethodMetaData.getMethodName();
            // timeout method params
            MethodParametersMetaData methodParams = timeoutMethodMetaData.getMethodParams();
            String[] paramTypes = methodParams == null ? null : methodParams.toArray(new String[methodParams.size()]);
            timeoutMethodParams = this.loadTimeoutMethodParamTypes(beanClass.getClassLoader(), paramTypes);
         }
      }
     
      Method timeoutMethod = timeoutMethodCallbackRequirements.getTimeoutMethod(beanClass, methodName, timeoutMethodParams);
View Full Code Here

      NamedMethodMetaData beanMethod = new NamedMethodMetaData();
      beanMethod.setMethodName(method.getName());
      metaData.setBeanMethod(beanMethod);
      metaData.setRetainIfException(remove.retainIfException());

      MethodParametersMetaData methodParams = ProcessorUtils.getMethodParameters(method);
      beanMethod.setMethodParams(methodParams);
     
      return metaData;
   }
View Full Code Here

      interceptor.setExcludeDefaultInterceptors(excludeDefaults != null);
      if(method != null)
      {
         NamedMethodMetaData namedMethod = new NamedMethodMetaData();
         namedMethod.setMethodName(method.getName());
         MethodParametersMetaData methodParams = ProcessorUtils.getMethodParameters(method);
         namedMethod.setMethodParams(methodParams);
         interceptor.setMethod(namedMethod);
      }
      InterceptorClassesMetaData classes = new InterceptorClassesMetaData();
      for(Class c : interceptors.value())
View Full Code Here

      {
         beanMethod.setMethodName(method.getName());
         createMethod.setMethodName(alternativeName);
      }
     
      MethodParametersMetaData methodParams = ProcessorUtils.getMethodParameters(method);
      beanMethod.setMethodParams(methodParams);
      createMethod.setMethodParams(methodParams);
     
      return metaData;
   }
View Full Code Here

TOP

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

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.