public MethodInfo ResolveMethod(
            Type clazz,
            String methodName,
            Type[] paramTypes,
            bool[] allowEventBeanType,
            bool[] allowEventBeanCollType)
        {
            try
            {
                return(MethodResolver.ResolveMethod(
                           clazz, methodName, paramTypes, true, allowEventBeanType, allowEventBeanType));
            }
            catch (EngineNoSuchMethodException e)
            {
                // Lets go looking for an extension method before throwing an exception
                var method = MethodResolver.ResolveExtensionMethod(
                    clazz, methodName, paramTypes, true, allowEventBeanType, allowEventBeanType);
                if (method == null)
                {
                    throw Convert(clazz, methodName, paramTypes, e, true);
                }

                return(method);
            }
        }
        public MethodInfo ResolveMethod(
            Type clazz,
            string methodName,
            Type[] paramTypes,
            bool[] allowEventBeanType)
        {
            try {
                return(MethodResolver.ResolveMethod(
                           clazz,
                           methodName,
                           paramTypes,
                           true,
                           allowEventBeanType,
                           allowEventBeanType));
            }
            catch (MethodResolverNoSuchMethodException e) {
                var method = MethodResolver.ResolveExtensionMethod(
                    clazz,
                    methodName,
                    paramTypes,
                    true,
                    allowEventBeanType,
                    allowEventBeanType);
                if (method != null)
                {
                    return(method);
                }

                throw Convert(clazz, methodName, paramTypes, e, true);
            }
        }
        private static MethodInfo GetMethod(
            Type clazz,
            string methodName,
            Type[] paramTypes,
            bool[] allFalse)
        {
            try {
                return MethodResolver.ResolveMethod(clazz, methodName, paramTypes, true, allFalse, allFalse);
            }
            catch (MethodResolverNoSuchMethodException) {
                var method = MethodResolver.ResolveExtensionMethod(
                    clazz,
                    methodName,
                    paramTypes,
                    true,
                    allFalse,
                    allFalse);
                if (method != null) {
                    return method;
                }

                Log.Debug("Not resolved for class '" + clazz.Name + "' method '" + methodName + "'");
            }
            catch (Exception) {
                Log.Debug("Not resolved for class '" + clazz.Name + "' method '" + methodName + "'");
            }

            return null;
        }
Exemple #4
0
        public MethodInfo ResolveMethodOverloadChecked(
            string className,
            string methodName,
            Type[] paramTypes,
            bool[] allowEventBeanType,
            bool[] allowEventBeanCollType,
            ExtensionClass extension)
        {
            Type clazz;
            try {
                clazz = ResolveClassInternal(className, false, false, extension);
            }
            catch (TypeLoadException e) {
                throw new ImportException(
                    "Could not load class by name '" + className + "', please check imports",
                    e);
            }

            try {
                return MethodResolver.ResolveMethod(
                    clazz,
                    methodName,
                    paramTypes,
                    false,
                    allowEventBeanType,
                    allowEventBeanCollType);
            }
            catch (MethodResolverNoSuchMethodException e) {
                var method = MethodResolver.ResolveExtensionMethod(
                    clazz, methodName, paramTypes, true, allowEventBeanType, allowEventBeanType);
                if (method == null) {
                    throw Convert(clazz, methodName, paramTypes, e, false);
                }

                return method;
            }
        }