private static Class<?> loadProxyClass(ClassLoader loader,Class<?>[] interfaces) throws ClassNotFoundException {
  try {
    return Proxy.getProxyClass(loader,interfaces);
  }
 catch (  IllegalArgumentException e) {
    throw new ClassNotFoundException("error creating dynamic proxy class",e);
  }
}

private static Class < ? > loadProxyClass ( ClassLoader loader , Class < ? > [ ] interfaces ) throws ClassNotFoundException { try { return Proxy . getProxyClass ( loader , interfaces ) ; } catch ( IllegalArgumentException e ) { throw new ClassNotFoundException ( "error creating dynamic proxy class" , e ) ; } }
define a proxy class in the given class loader . the proxy class will implement the given interfaces classes .
