Package org.jboss.metadata.ejb.spec

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


            {
               log.trace("Async method names match: " + invokedMethodName);
            }

            // Params match?
            final MethodParametersMetaData asyncParams = asyncMethod.getMethodParams();
            final Class<?>[] invokedParams = actualMethod.getParameterTypes();
            final int invokedParamsSize = invokedParams.length;
            if (asyncParams.size() != invokedParams.length)
            {
               if (log.isTraceEnabled())
               {
                  log.trace("Different async params size, no match");
               }
               return false;
            }
            for (int i = 0; i < invokedParamsSize; i++)
            {
               final String invokedParamTypeName = invokedParams[i].getName();
               final String declaredName = asyncParams.get(i);
               if (!invokedParamTypeName.equals(declaredName))
               {
                  return false;
               }
            }
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

                        MethodIntf methodIntf = this.getMethodIntf(method.getMethodIntf());
                        if (methodName.equals("*")) {
                            sessionBeanDescription.setTransactionAttribute(methodIntf, className, txAttr);
                        } else {

                            MethodParametersMetaData methodParams = method.getMethodParams();
                            // update the session bean description with the tx attribute info
                            sessionBeanDescription.setTransactionAttribute(methodIntf, txAttr, className, methodName, this.getMethodParams(methodParams));
                        }
                    }
                }
View Full Code Here

                    ejbComponentDescription.applyDenyAllOnAllMethodsOfAllViews();
                } else {
                    ejbComponentDescription.applyDenyAllOnAllMethodsOfViewType(methodIntf);
                }
            } else {
                final MethodParametersMetaData methodParams = denyAllMethod.getMethodParams();
                // style 2
                //            <method>
                //                <ejb-name>EJBNAME</ejb-name>
                //                <method-name>METHOD</method-name>
                //              </method>
                if (methodParams == null || methodParams.isEmpty()) {
                    final Collection<Method> denyAllApplicableMethods = ClassReflectionIndexUtil.findAllMethodsByName(deploymentReflectionIndex, classReflectionIndex, methodName);
                    // just log a WARN message and proceed, in case there was no method by that name
                    if (denyAllApplicableMethods.isEmpty()) {
                        logger.warn("No method named: " + methodName + " found on EJB: " + ejbName + " while processing exclude-list element in ejb-jar.xml");
                        continue;
                    }
                    // apply the @DenyAll/exclude-list
                    this.applyDenyAll(ejbComponentDescription, methodIntf, denyAllApplicableMethods);

                } else {
                    // style 3
                    //            <method>
                    //                <ejb-name>EJBNAME</ejb-name>
                    //                <method-name>METHOD</method-name>
                    //                <method-params>
                    //                <method-param>PARAMETER_1</method-param>
                    //                ...
                    //                <method-param>PARAMETER_N</method-param>
                    //                </method-params>
                    //
                    //              </method>
                    final String[] paramTypes = methodParams.toArray(new String[methodParams.size()]);
                    final Collection<Method> denyAllApplicableMethods = ClassReflectionIndexUtil.findMethods(deploymentReflectionIndex, classReflectionIndex, methodName, paramTypes);
                    // just log a WARN message and proceed, in case there was no method by that name and param types
                    if (denyAllApplicableMethods.isEmpty()) {
                        logger.warn("No method named: " + methodName + " with param types: " + paramTypes + " found on EJB: " + ejbName + " while processing exclude-list element in ejb-jar.xml");
                        continue;
View Full Code Here

                        ejbComponentDescription.setRolesAllowedForAllMethodsOfAllViews(securityRoles);
                    } else {
                        ejbComponentDescription.setRolesAllowedForAllMethodsOnViewType(methodIntf, securityRoles);
                    }
                } else {
                    final MethodParametersMetaData methodParams = method.getMethodParams();
                    // style 2
                    //            <method>
                    //                <ejb-name>EJBNAME</ejb-name>
                    //                <method-name>METHOD</method-name>
                    //              </method>
                    if (methodParams == null || methodParams.isEmpty()) {
                        final Collection<Method> applicableMethods = ClassReflectionIndexUtil.findAllMethodsByName(deploymentReflectionIndex, classReflectionIndex, methodName);
                        // just log a WARN message and proceed, in case there was no method by that name
                        if (applicableMethods.isEmpty()) {
                            logger.warn("No method named: " + methodName + " found on EJB: " + ejbName + " while processing method-permission element in ejb-jar.xml");
                            continue;
                        }
                        // apply the @RolesAllowed/method-permission
                        this.setRolesAllowed(ejbComponentDescription, methodIntf, applicableMethods, securityRoles);

                    } else {
                        // style 3
                        //            <method>
                        //                <ejb-name>EJBNAME</ejb-name>
                        //                <method-name>METHOD</method-name>
                        //                <method-params>
                        //                <method-param>PARAMETER_1</method-param>
                        //                ...
                        //                <method-param>PARAMETER_N</method-param>
                        //                </method-params>
                        //
                        //              </method>
                        final String[] paramTypes = methodParams.toArray(new String[methodParams.size()]);
                        final Collection<Method> applicableMethods = ClassReflectionIndexUtil.findMethods(deploymentReflectionIndex, classReflectionIndex, methodName, paramTypes);
                        // just log a WARN message and proceed, in case there was no method by that name and param types
                        if (applicableMethods.isEmpty()) {
                            logger.warn("No method named: " + methodName + " with param types: " + paramTypes + " found on EJB: " + ejbName + " while processing method-permission element in ejb-jar.xml");
                            continue;
View Full Code Here

    */
   private Method getTimeoutMethod(NamedMethodMetaData timeoutMethodMetaData, Class<?> beanClass)
   {

      String timeoutMethodName = timeoutMethodMetaData.getMethodName();
      MethodParametersMetaData timeoutMethodParams = timeoutMethodMetaData.getMethodParams();

      List<Method> probableTimeoutMethods = ClassHelper.getAllMethodsByName(beanClass, timeoutMethodName);
      if (probableTimeoutMethods == null || probableTimeoutMethods.isEmpty())
      {
         return null;
      }
      if (timeoutMethodParams == null)
      {
         if (probableTimeoutMethods.size() > 1)
         {
            throw new IllegalStateException("Found more than one timeout method with name: " + timeoutMethodName
                  + " on bean " + beanClass);
         }
         // match found
         return probableTimeoutMethods.get(0);
      }

      // load the method param classes
      Class<?>[] timeoutMethodParamTypes = new Class<?>[timeoutMethodParams.size()];
      int i = 0;
      for (String paramClassName : timeoutMethodParams)
      {
         Class<?> methodParamClass = null;
         try
View Full Code Here

/* 73 */     interceptor.setExcludeDefaultInterceptors(excludeDefaults != null);
/* 74 */     if (method != null)
/*    */     {
/* 76 */       NamedMethodMetaData namedMethod = new NamedMethodMetaData();
/* 77 */       namedMethod.setMethodName(method.getName());
/* 78 */       MethodParametersMetaData methodParams = ProcessorUtils.getMethodParameters(method);
/* 79 */       namedMethod.setMethodParams(methodParams);
/* 80 */       interceptor.setMethod(namedMethod);
/*    */     }
/* 82 */     InterceptorClassesMetaData classes = new InterceptorClassesMetaData();
/* 83 */     for (Class c : interceptors.value())
View Full Code Here

/* 63 */     NamedMethodMetaData beanMethod = new NamedMethodMetaData();
/* 64 */     beanMethod.setMethodName(method.getName());
/* 65 */     metaData.setBeanMethod(beanMethod);
/* 66 */     metaData.setRetainIfException(remove.retainIfException());
/*    */
/* 68 */     MethodParametersMetaData methodParams = ProcessorUtils.getMethodParameters(method);
/* 69 */     beanMethod.setMethodParams(methodParams);
/*    */
/* 71 */     return metaData;
/*    */   }
View Full Code Here

/*     */     {
/*  77 */       beanMethod.setMethodName(method.getName());
/*  78 */       createMethod.setMethodName(alternativeName);
/*     */     }
/*     */
/*  81 */     MethodParametersMetaData methodParams = ProcessorUtils.getMethodParameters(method);
/*  82 */     beanMethod.setMethodParams(methodParams);
/*  83 */     createMethod.setMethodParams(methodParams);
/*     */
/*  85 */     return metaData;
/*     */   }
View Full Code Here

/*  99 */     if (method == null) {
/* 100 */       methodMetaData.setMethodName("*");
/*     */     }
/*     */     else {
/* 103 */       methodMetaData.setMethodName(method.getName());
/* 104 */       MethodParametersMetaData methodParameters = getMethodParameters(method);
/* 105 */       if (methodParameters != null)
/* 106 */         methodMetaData.setMethodParams(methodParameters);
/*     */     }
/* 108 */     return methodMetaData;
/*     */   }
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.