FileDocCategorySizeDatePackage
AppservClassLoader.javaAPI DocGlassfish v2 API5216Fri May 04 22:32:42 BST 2007org.apache.tools.ant.taskdefs.optional.sun.appserv

AppservClassLoader

public class AppservClassLoader extends URLClassLoader

Fields Summary
private Hashtable
hashTable
Constructors Summary
public AppservClassLoader()
Creates new AppservClassLoader _mapping is key=value;key=value....

 // small
    
           
         
        super(new URL[0], AppservClassLoader.class.getClassLoader());
    
Methods Summary
public voidaddURL(java.io.File f)

            if (f.isFile()){
                addURL(f.toURI().toURL());
              ///  System.out.println("adding file  = "+f.getAbsolutePath());
              ///  System.out.println("adding file  exists= "+f.exists() );
            }
            else{
              ///  System.out.println("file does not exist!!! = "+f.getAbsolutePath());
            }
    
public static org.apache.tools.ant.taskdefs.optional.sun.appserv.AppservClassLoadergetClassLoader()

        
        AppservClassLoader loader = null;

        try {
            loader = new AppservClassLoader();
            String installRoot = System.getProperty("com.sun.aas.installRoot");
            if (installRoot == null) {
                    //set installRoot to current directory
                installRoot = ".";
            }

            File f;
            
            final String classpathPrefix = System.getProperty("com.sun.ant.classpath.prefix");
            if (classpathPrefix != null) {
                f = new File(classpathPrefix);
                loader.addURL(f);
            }

            final String derbyRoot = System.getProperty("derby.root");
            if (derbyRoot != null) {
                //set derby jar file
                f = new File (derbyRoot+"/lib/derby.jar");
                loader.addURL(f);
            }
            
            f = new File(installRoot+"/lib");
            loader.addURL(f);
            f = new File(installRoot+"/lib/webservices-rt.jar");
            loader.addURL(f);
            f = new File(installRoot+"/lib/webservices-tools.jar");
            loader.addURL(f);
            f = new File(installRoot+"/lib/appserv-se.jar");
            loader.addURL(f);
            f = new File(installRoot+"/lib/appserv-admin.jar");
            loader.addURL(f);
            f = new File(installRoot+"/lib/appserv-ext.jar");
            loader.addURL(f);
            f = new File(installRoot+"/lib/appserv-rt.jar");
            loader.addURL(f);
            f = new File(installRoot+"/lib/appserv-cmp.jar");
            loader.addURL(f);
            f = new File(installRoot+"/lib/admin-cli.jar");
            loader.addURL(f);
            f = new File(installRoot+"/lib/commons-launcher.jar");
            loader.addURL(f);
            f = new File(installRoot+"/lib/javaee.jar");
            loader.addURL(f);
            f = new File(installRoot+"/lib/install/applications/jmsra/imqjmsra.jar");
            loader.addURL(f);
        }catch (Exception ex) {
            ex.printStackTrace();
                //throw new Exception(ex2.getLocalizedMessage());
        }
        return loader;