public Object invoke(String actionName, Object[] params, String[] signature)
            throws MBeanException, ReflectionException {
        Method method = operationMethods.get(actionName);
        //TODO verify that the right signature is picked to avoid throwing an IllegalArgumentException
        if (method == null) {
            throw new IllegalArgumentException("No such operation: " + actionName);
        }
        try {
            if (!method.isAccessible()) {
                method.setAccessible(true);
            }
            return method.invoke(mbean, params);
        } catch (InvocationTargetException e) {
            throw new MBeanException((Exception) e.getCause());
        } catch (Exception e) {
            throw new IllegalArgumentException(e);
        }

    }
public Object invoke ( String actionName , Object [ ] params , String [ ] signature ) throws MBeanException , ReflectionException { Method method = operationMethods . get ( actionName ) ; if ( method == null ) { throw new IllegalArgumentException ( "No such operation: " + actionName ) ; } try { if ( ! method . isAccessible ( ) ) { method . setAccessible ( true ) ; } return method . invoke ( mbean , params ) ; } catch ( InvocationTargetException e ) { throw new MBeanException ( ( Exception ) e . getCause ( ) ) ; } catch ( Exception e ) { throw new IllegalArgumentException ( e ) ; } }
@Override commented out for JDK 5 compatibility