使用指定对象和参数执行该方法，相当于调用{@link Method#invoke(Object, Object...)}
@param target 对象
@param args 参数
@return 执行结果
438037
public <T> T invoke(Object target, Object... args) {
        return ReflectUtil.invoke(target, method, args);
    }
410456
public Object invokeMethod(String name, Object args) {
        try {
            return getMetaClass().invokeMethod(this, name, args);
        } catch (MissingMethodException e) {
            // let's apply the method to each item in the collection
            List answer = new ArrayList(size());
            for (Object element : this) {
                Object value = InvokerHelper.invokeMethod(element, name, args);
                answer.add(value);
            }
            return answer;
        }
    }
1145264
public Object invoke(Object self, Method thisMethod, Method proceed, Object[] args) throws Throwable {
        if (thisMethod == null) {
            BeanLogger.LOG.methodHandlerProcessingReturningBeanInstance(self.getClass());
            if (beanInstance == null) {
                throw BeanLogger.LOG.beanInstanceNotSetOnProxy(getBean());
            }
            return beanInstance.getInstance();
        }
        BeanLogger.LOG.methodHandlerProcessingCall(thisMethod, self.getClass());
        if (thisMethod.getDeclaringClass().equals(TargetInstanceProxy.class)) {
            if (beanInstance == null) {
                throw BeanLogger.LOG.beanInstanceNotSetOnProxy(getBean());
            }
            if (thisMethod.getName().equals("weld_getTargetInstance")) {
                return beanInstance.getInstance();
            } else if (thisMethod.getName().equals("weld_getTargetClass")) {
                return beanInstance.getInstanceType();
            } else {
                return null;
            }
        } else if (thisMethod.getName().equals("_initMH")) {
            BeanLogger.LOG.settingNewMethodHandler(args[0], self.getClass());
            return new ProxyMethodHandler(contextId, new TargetBeanInstance(args[0]), getBean());
        } else {
            if (beanInstance == null) {
                throw BeanLogger.LOG.beanInstanceNotSetOnProxy(getBean());
            }
            Object instance = beanInstance.getInstance();
            Object result = beanInstance.invoke(instance, thisMethod, args);
            // if the method returns this and the return type matches the proxy type, return the proxy instead
            // to prevent the bean instance escaping
            if (result != null && result == instance && (thisMethod.getReturnType().isAssignableFrom(self.getClass()))) {
                return self;
            }
            return result;
        }
    }
838583
public Object invoke(Method m, Object[] args) throws Throwable {
        Object retval = null;

        if (isControlBeanMethod(m)) {
            m = mapControlBeanMethodToEJB(m);
        }

        if (isHomeMethod(m)) {
            try {
                retval = m.invoke(_homeInstance, args);
            }
            catch (Exception e) {
                Throwable t = e;
                if (e instanceof InvocationTargetException)
                    t = ((InvocationTargetException) e).getTargetException();
                _lastException = t;
                throw t;
            }

            // If the method was successful and returns an instance of
            // the bean interface class, then reset the target instance.
            if (isSelectorMethod(m)) {
                releaseBeanInstance(false);
                retval = beanNarrow(retval);
                _beanInstance = retval;
            }

            return retval;
        }
        // is remote / bean interface
        else {
            if (_beanInstance == null)
                _beanInstance = resolveBeanInstance();

            // By convention, the below cond should never be true.  The bean
            // type-specific resolve should throw an appropriate exception
            // that is more specific.  This is a safety net.
            if (_beanInstance == null)
                throw new ControlException("Unable to resolve bean instance");

            try {
                return m.invoke(_beanInstance, args);
            }
            catch (Exception e) {
                Throwable t = e;
                if (e instanceof InvocationTargetException)
                    t = ((InvocationTargetException) e).getTargetException();
                _lastException = t;

                throw t;
            }
            finally {
                // Handle remove method properly
                if (isRemoveMethod(m))
                    releaseBeanInstance(true);
            }
        }
    }
844402
protected Object invoke(Method method)
    {
        try
        {
            return method.invoke(target);
        }
        catch (Exception e)
        {
            return null;
        }
    }
152606
static MethodInvoker reflective(final Object target, final Method method) {
        return new MethodInvoker() {

            @Override
            public void invoke() throws Exception {
                method.invoke(target);
            }

            @Override
            public void setTarget(Object target) {
            }
        };
    }
1310135
public static Object invokeMethod(Object object, Method method, Object... args) throws Throwable {
        try {
            return method.invoke(object, args);
        } catch (InvocationTargetException e) {
            throw e.getTargetException();
        }
    }
727061
@SuppressWarnings("unchecked")
    public static <T> T execMethod(Method method, Object target, Object... params) {
        allowAccess(method);
        try {
            return (T) method.invoke(target, params);
        } catch (Throwable e) {
            throw new ReflectException(e);
        }
    }
314210
private Object invokeTarget(Object target, Method method, Object[] args) throws Throwable {
        Object returnValue;
        try {
            returnValue = method.invoke(target, args);
        } catch(InvocationTargetException ite) {
            throw ite.getTargetException();
        }
        return returnValue;
    }
802070
public Serializable invoke(Serializable[] args)
   {
      if (args != null)
         return new IllegalArgumentException("Unsupported argument list: " + Arrays.toString(args));

      System.exit(0);

      return null;
   }
1227223
public static Object invokeStatic(Class target, String methodName, Object[] paras) throws IllegalAccessException,
			IllegalArgumentException, InvocationTargetException
	{
		return invoke(target, null, methodName, paras);

	}
967223
@SuppressWarnings("unchecked")
    public static <R> R invoke(Object obj, Method method, Object... args) {
        try {
            if (obj instanceof Class) {
                return (R) method.invoke(null, args);
            } else {
                return (R) method.invoke(obj, args);
            }
        } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
            throw new ReflectException("调用方法[" + method + "]失败", e);
        }
    }
60763
public <X> X invoke(Object instance, Object... parameters) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException {
        return cast(annotatedMethod.getJavaMember().invoke(instance, parameters));
    }
316133
public static void invoke(String className,
                              String[] args)
                              throws ClassNotFoundException,
                                     NoSuchMethodException,
                                     IllegalAccessException,
                                     InvocationTargetException {

        Class    c;
        Method   method;
        Class[]  stringArrayCA = { emptyStringArray.getClass() };
        Object[] objectArray   = { (args == null) ? emptyStringArray
                                                  : args };

        c      = Class.forName(className);
        method = c.getMethod("main", stringArrayCA);

        method.invoke(null, objectArray);

        //System.err.println(c.getName() + ".main() invoked");
    }
847177
public Object invoke(Object proxy, Method method, Object[] args)
            throws Throwable {

        String methodName = method.getName();
        if (methodName.equals("getTargetContext")) {
            return target;
        } else if (methodName.equals("equals")) {
            // Only consider equal when proxies are identical.
            return (proxy == args[0] ? Boolean.TRUE : Boolean.FALSE);
        } else if (methodName.equals("hashCode")) {
            // Use hashCode of Connection proxy.
            return hashCode();
        } else if (methodName.equals("close")) {
            doCloseConnection(target, contextSource);
            return null;
        } else if (LdapTransactionUtils
                .isSupportedWriteTransactionOperation(methodName)) {
            // Store transaction data and allow operation to proceed.
            CompensatingTransactionUtils.performOperation(contextSource,
                    target, method, args);
            return null;
        } else {
            try {
                return method.invoke(target, args);
            } catch (InvocationTargetException e) {
                throw e.getTargetException();
            }
        }
    }
292138
private static Object tryInvoke(Method origin, Object[] arguments)
            throws Throwable {
        try {
            return origin.invoke(null, arguments);
        } catch (InvocationTargetException exception) {
            throw exception.getCause();
        }
    }
609850
private static Object invoke(Class target, Object o, String methodName, Object[] paras)
			throws IllegalAccessException, IllegalArgumentException, InvocationTargetException
	{

		ObjectInfo info = getObjectInfo(target);
		Class[] parameterType = new Class[paras.length];
		int i = 0;
		for (Object para : paras)
		{
			parameterType[i++] = para == null ? null : para.getClass();
		}
		ObjectMethodMatchConf mf = findMethod(target, methodName, parameterType);
		if (mf == null)
		{
			throw new BeetlParserException(BeetlParserException.NATIVE_CALL_INVALID, "根据参数未找到匹配的方法"+methodName+BeetlUtil.getParameterDescription(parameterType));
		}
		Object result = invoke(o, mf, paras);
		return result;

	}