public ClassLoader getSiteClassLoader ( int siteId ) throws IOException { // synchronize on the lock to ensure that only one thread per site // is concurrently executing synchronized ( getLock ( siteId ) ) { // see if we've already got one ClassLoader loader = _loaders . get ( siteId ) ; // create one if we've not if ( loader == null ) { final SiteResourceBundle bundle = getBundle ( siteId ) ; if ( bundle == null ) { // no bundle... no classloader. return null ; } loader = AccessController . doPrivileged ( new PrivilegedAction < SiteClassLoader > ( ) { public SiteClassLoader run ( ) { return new SiteClassLoader ( bundle ) ; } } ) ; _loaders . put ( siteId , loader ) ; } return loader ; } }
Returns a class loader that loads resources from the site - specific jar file for the specified site . If no site - specific jar file exists for the specified site null will be returned .