1 package hudson.remoting; 2 3 import hudson.remoting.RemoteClassLoader.IClassLoader; 4 5 import java.util.Hashtable ; 6 import java.util.Map ; 7 8 11 final class ImportedClassLoaderTable { 12 final Channel channel; 13 final Map <IClassLoader,ClassLoader > classLoaders = new Hashtable <IClassLoader,ClassLoader >(); 14 15 ImportedClassLoaderTable(Channel channel) { 16 this.channel = channel; 17 } 18 19 public synchronized ClassLoader get(int oid) { 20 return get(RemoteInvocationHandler.wrap(channel,oid,IClassLoader.class,false)); 21 } 22 23 public synchronized ClassLoader get(IClassLoader classLoaderProxy) { 24 ClassLoader r = classLoaders.get(classLoaderProxy); 25 if(r==null) { 26 r = new RemoteClassLoader(getClass().getClassLoader(),classLoaderProxy); 29 classLoaders.put(classLoaderProxy,r); 30 } 31 return r; 32 } 33 } 34 | Popular Tags |