src/main/java/org/ucmtwine/proxy/ScriptProxy.java
public Object runFunctionMethod(int functionIndex, Object[] args, ExecutionContext ctx) throws SecurityException,
      NoSuchMethodException, IllegalArgumentException, ServiceException, IllegalAccessException,
      InvocationTargetException {
    Method method = functionMethods[functionIndex];

    Object params[] = getInjectedValueArray(method, args, ctx);

    Object result;
    try {
      result = method.invoke(m_class.newInstance(), params);

    } catch (InstantiationException e) {
      // TODO catch and re-throw ewwwww
      throw new ServiceException("Cannot delegate instantiate script context: " + e.getMessage());
    }

    if (result == null) {
      return result;
    }

    return convertReturnValue(result);
  }
public Object runFunctionMethod(int functionIndex, Object[] args, ExecutionContext ctx) throws SecurityException,
      NoSuchMethodException, IllegalArgumentException, ServiceException, IllegalAccessException,
      InvocationTargetException {
    Method method = functionMethods[functionIndex];

    Object params[] = getInjectedValueArray(method, args, ctx);

    Object result;
    try {
      result = method.invoke(m_class.newInstance(), params);

    } catch (InstantiationException e) {
      // TODO catch and re-throw ewwwww
      throw new ServiceException("Cannot delegate instantiate script context: " + e.getMessage());
    }

    if (result == null) {
      return result;
    }

    return convertReturnValue(result);
  }
Executes the annotated method.

@param functionIndex
@param args
@param ctx
@return
@throws IllegalArgumentException
@throws ServiceException
@throws SecurityException
@throws NoSuchMethodException
@throws IllegalAccessException
@throws InvocationTargetException