Package com.sun.appserv.server.util

Examples of com.sun.appserv.server.util.ClassLoaderChain


     * @return
     */
    private static ClassLoader createApplicationLibrariesClassLoader(
                                           ClassLoader parentClassLoader, URL[] urlList, String moduleId) {
        if( urlList != null ) {
            ClassLoaderChain appChain = new ClassLoaderChain(parentClassLoader);
            appChain.setName("Application library chain for " + moduleId);
            for(URL url:urlList){
                try {
          ClassLoader urlLoader = classLoaderRegistry.get(url.toURI());
                //if this library has already been referred in a different application and been
                //loaded, share this library by reusing the same classloader.
                if(urlLoader == null) {
                    urlLoader = new ASURLClassLoader(new URL[]{url}, parentClassLoader);
              classLoaderRegistry.put(url.toURI(),urlLoader);
                }
                appChain.addToList(urlLoader);
        } catch (URISyntaxException e) {
          _logger.log(Level.FINE, "Error while resolving " + url + " to URI");
          _logger.log(Level.WARNING, e.getMessage());

        }
            }
           
            //Finally suffix the optional chain. The optional chain is suffixed to the appchain
            //to enable an administrator to override libraries in the optional chain via
            //the libraris deploy-time attribute.
            ClassLoader optionalChain = PELaunch.getOptionalChain();
            appChain.addToList(optionalChain);
            return appChain;
        }
        return null;
    }
View Full Code Here


        System.setProperty("java.class.path", classpath.toString());
    }

    private static void setupAddOnChain() {
      logFine("setting up addon chain");
        _addOnsChain = new ClassLoaderChain(_sharedClassLoader);
        _addOnsChain.setName("Addons Chain");
        getManifestAddonJars();
       
        for (final String addOnName : addOnsManifestsMap.keySet()) {
          //create a classloader for an addon
View Full Code Here

     * an explicit dependency. This chain consists of all AS provided libraries
     * that could be overridden by an application.
     */
    private static void setupOptionalOverrideableChain(){
        
        _optionalChain = new ClassLoaderChain(_addOnsChain);
        _optionalChain.setName("optionalChain");
       
        final URL[] urls = getURLList(_optionalClasspath);
        //Parent set to Shared Chain
        final ASURLClassLoader optionalJarsLoader = new ASURLClassLoader(urls,
View Full Code Here

     */
    private static void setupAppServerChain(){
        final URL[] urls = getURLList(_appserverClasspath);
       
        //parent set to Shared Chain
        _asChain = new ClassLoaderChain(_addOnsChain);
        _asChain.setName("ASChain");
       
        final ASURLClassLoader asimplloader = new ASURLClassLoader(urls, _asChain);
        asimplloader.setName("asimpl");
        _asChain.addToList(asimplloader);
View Full Code Here

TOP

Related Classes of com.sun.appserv.server.util.ClassLoaderChain

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.