1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
private List<Item> trouverElementsCriteres(RemoteServices remoteServices, String nommeth, Integer idCentre, String annee, String etat ) throws ClassNotFoundException, NoSuchMethodException, IllegalArgumentException, IllegalAccessException, InvocationTargetException{
InvocationHandler mandataire = Proxy.getInvocationHandler(remoteServices);
ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
Class[] interfaces = new Class[]{RemoteServices.class};
Object proxy = java.lang.reflect.Proxy.newProxyInstance(contextClassLoader, interfaces, mandataire);
Class clazz = proxy.getClass();
if(logger.isDebugEnabled()){
logger.debug(" classe de l'objet chaine " + clazz.getName());
}
List<StatisticItemDTO> sItemDTOs =null;
Method laMethode = trouverLaMethode(clazz,nommeth, new Class[]{Integer.class, String.class, String.class});
return (List<Item>)laMethode.invoke(clazz, new Object[]{idCentre,annee,etat});
} |