package es.ejie.frmk.negocio.adaptadorinvocacion;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

public class Q70InvocadorMetodos {

	protected static Object invoke(Object o, String methodName, Object[] args, Class[] argsTypes)
			throws IllegalArgumentException, IllegalAccessException, InvocationTargetException,
			SecurityException, NoSuchMethodException {
		
		// buscar un metodo adecuado.
		Method method = o.getClass().getMethod(methodName, argsTypes);
		return method.invoke(o, args);
	}
}
