1 45 46 package org.openejb.loader; 47 48 import java.io.File ; 49 import java.net.URLClassLoader ; 50 import java.net.URL ; 51 52 55 56 57 58 public class ContextClassPath extends BasicURLClassPath { 59 60 public ClassLoader getClassLoader() { 61 return getContextClassLoader(); 62 } 63 64 public void addJarsToPath(File dir) throws Exception { 65 ClassLoader contextClassLoader = getContextClassLoader(); 66 if (contextClassLoader instanceof URLClassLoader ) { 67 URLClassLoader loader = (URLClassLoader ) contextClassLoader; 68 this.addJarsToPath(dir, loader); 69 } 70 } 71 72 public void addJarToPath(URL jar) throws Exception { 73 ClassLoader contextClassLoader = getContextClassLoader(); 74 if (contextClassLoader instanceof URLClassLoader ) { 75 URLClassLoader loader = (URLClassLoader ) contextClassLoader; 76 this.addJarToPath(jar, loader); 77 } 78 } 79 } 80 | Popular Tags |