protected Object doInvoke ( Object ... args ) throws Exception { ReflectionUtils . makeAccessible ( getBridgedMethod ( ) ) ; try { return getBridgedMethod ( ) . invoke ( getBean ( ) , args ) ; } catch ( IllegalArgumentException ex ) { assertTargetBean ( getBridgedMethod ( ) , getBean ( ) , args ) ; throw new IllegalStateException ( getInvocationErrorMessage ( ex . getMessage ( ) , args ) , ex ) ; } catch ( InvocationTargetException ex ) { // Unwrap for HandlerExceptionResolvers ... Throwable targetException = ex . getTargetException ( ) ; if ( targetException instanceof RuntimeException ) { throw ( RuntimeException ) targetException ; } else if ( targetException instanceof Error ) { throw ( Error ) targetException ; } else if ( targetException instanceof Exception ) { throw ( Exception ) targetException ; } else { String msg = getInvocationErrorMessage ( "Failed to invoke controller method" , args ) ; throw new IllegalStateException ( msg , targetException ) ; } } }
Invoke the handler method with the given argument values .