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 .