private Class loadProxyClass(String[] interfaceNames,ClassLoader interfaceLoader,String interfaceLoaderName,ClassLoader otherLoader,boolean tryOtherLoaderFirst) throws ClassNotFoundException {
  Class[] classObjs=new Class[interfaceNames.length];
  boolean[] nonpublic={false};
  ClassLoader proxyLoader=loadProxyInterfaces(interfaceNames,interfaceLoader,classObjs,nonpublic);
  if (logger.isLoggable(Level.FINEST)) {
    ClassLoader[] definingLoaders=new ClassLoader[classObjs.length];
    for (int i=0; i < definingLoaders.length; i++) {
      definingLoaders[i]=getClassLoader(classObjs[i]);
    }
    logger.log(Level.FINEST,"proxy interfaces loaded via {0}, defined by {1}",new Object[]{interfaceLoaderName,Arrays.asList(definingLoaders)});
  }
  if (!nonpublic[0]) {
    if (tryOtherLoaderFirst) {
      try {
        return Proxy.getProxyClass(otherLoader,classObjs);
      }
 catch (      IllegalArgumentException e) {
      }
    }
    proxyLoader=interfaceLoader;
  }
  return Proxy.getProxyClass(proxyLoader,classObjs);
}

private Class loadProxyClass ( String [ ] interfaceNames , ClassLoader interfaceLoader , String interfaceLoaderName , ClassLoader otherLoader , boolean tryOtherLoaderFirst ) throws ClassNotFoundException { Class [ ] classObjs = new Class [ interfaceNames . length ] ; boolean [ ] nonpublic = { false } ; ClassLoader proxyLoader = loadProxyInterfaces ( interfaceNames , interfaceLoader , classObjs , nonpublic ) ; if ( logger . isLoggable ( Level . FINEST ) ) { ClassLoader [ ] definingLoaders = new ClassLoader [ classObjs . length ] ; for ( int i = 0 ; i < definingLoaders . length ; i ++ ) { definingLoaders [ i ] = getClassLoader ( classObjs [ i ] ) ; } logger . log ( Level . FINEST , "proxy interfaces loaded via {0}, defined by {1}" , new Object [ ] { interfaceLoaderName , Arrays . asList ( definingLoaders ) } ) ; } if ( ! nonpublic [ 0 ] ) { if ( tryOtherLoaderFirst ) { try { return Proxy . getProxyClass ( otherLoader , classObjs ) ; } catch ( IllegalArgumentException e ) { } } proxyLoader = interfaceLoader ; } return Proxy . getProxyClass ( proxyLoader , classObjs ) ; }
attempts to load the specified interfaces by name using the specified loader , and if that is successul , attempts to get a dynamic proxy class that implements those interfaces . if tryotherloaderfirst is true , attempts to get the proxy class defined by the specified other loader first , and if that fails , falls back to get the proxy class defined by the same loader used to load the interfaces ; otherwise , only attempts to get the proxy class defined by the same loader used to load the interfaces . throws a classnotfoundexception if attempting to load any of the interfaces throws a classnotfoundexception . throws illegalargumentexception if the final attempt to get a proxy class throws an illegalargumentexception .
