1 22 package org.jboss.system; 23 24 import java.net.MalformedURLException ; 25 26 import java.rmi.server.RMIClassLoader ; 27 import java.rmi.server.RMIClassLoaderSpi ; 28 29 55 public class JBossRMIClassLoader 56 extends RMIClassLoaderSpi 57 { 58 60 63 RMIClassLoaderSpi delegate = RMIClassLoader.getDefaultProviderInstance(); 64 65 67 70 public JBossRMIClassLoader() 71 { 72 } 73 74 76 79 public Class loadProxyClass(String codebase, String [] interfaces, ClassLoader ignored) 80 throws MalformedURLException , ClassNotFoundException 81 { 82 return delegate.loadProxyClass(codebase, interfaces, Thread.currentThread().getContextClassLoader()); 83 } 84 85 88 public Class loadClass(String codebase, String name, ClassLoader ignored) 89 throws MalformedURLException , ClassNotFoundException 90 { 91 return delegate.loadClass(codebase, name, Thread.currentThread().getContextClassLoader()); 92 } 93 94 97 public ClassLoader getClassLoader(String codebase) 98 throws MalformedURLException 99 { 100 return delegate.getClassLoader(codebase); 101 } 102 103 107 public String getClassAnnotation(Class cl) 108 { 109 String annotation = null; 110 try 111 { 112 annotation = delegate.getClassAnnotation(cl); 113 } 114 catch(Throwable t) 115 { 116 annotation = System.getProperty("java.rmi.server.codebase"); 118 } 119 return annotation; 120 } 121 } 122 | Popular Tags |