1 26 27 28 package org.objectweb.mobilitools.smi.lib; 29 30 31 import org.omg.CfMAF.AgentProfile; 32 import org.omg.CfMAF.MAFAgentSystem; 33 import java.net.MalformedURLException ; 34 import java.net.URLClassLoader ; 35 import java.net.URL ; 36 import java.util.Hashtable ; 37 import org.objectweb.mobilitools.smi.Misc; 38 39 40 45 abstract public class URLClassLoaderAdapter 46 { 47 static Hashtable loaders = new Hashtable (); 48 49 50 60 static public ClassLoader getClassLoader( 61 ClassLoader parent, 62 String codebase, 63 AgentProfile profile, 64 MAFAgentSystem provider) 65 throws MalformedURLException 66 { 67 Object loader = loaders.get(codebase); 68 if (loader == null) 69 { 70 loader = URLClassLoader.newInstance( 71 Misc.codebase2URLs(codebase), 72 parent); 73 loaders.put(codebase, loader); 74 } 75 return (ClassLoader )loader; 76 } 77 } 78 | Popular Tags |