|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.rmi.server.RMIClassLoaderSpi
org.jboss.system.JBossRMIClassLoader
public class JBossRMIClassLoader
An implementation of RMIClassLoaderSpi to workaround the proxy ClassCastException problem in 1.4
THIS IS A HACK!
Sun's implementation uses the caller classloader when unmarshalling proxies. This is effectively jboss.jar since that is where JRMPInvokerProxy lives. On a redeploy the new interfaces are ignored because a proxy is already cached against the classloader.
Another redeployment problem is that the getClassAnnotation(String) will end up using the old deployment class loader and this can result in NPEs do the class loader being destroyed. This class ignores Sun's guess at a suitable classloader and uses the thread context classloader instead.
It has to exist in the system classloader so I have included it in "system" for inclusion in run.jar
Constructor Summary | |
---|---|
JBossRMIClassLoader()
Required constructor |
Method Summary | |
---|---|
String |
getClassAnnotation(Class<?> cl)
|
ClassLoader |
getClassLoader(String codebase)
|
Class<?> |
loadClass(String codebase,
String name,
ClassLoader ignored)
|
Class<?> |
loadProxyClass(String codebase,
String[] interfaces,
ClassLoader ignored)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JBossRMIClassLoader()
Method Detail |
---|
public Class<?> loadProxyClass(String codebase, String[] interfaces, ClassLoader ignored) throws MalformedURLException, ClassNotFoundException
loadProxyClass
in class RMIClassLoaderSpi
MalformedURLException
ClassNotFoundException
public Class<?> loadClass(String codebase, String name, ClassLoader ignored) throws MalformedURLException, ClassNotFoundException
loadClass
in class RMIClassLoaderSpi
MalformedURLException
ClassNotFoundException
public ClassLoader getClassLoader(String codebase) throws MalformedURLException
getClassLoader
in class RMIClassLoaderSpi
MalformedURLException
public String getClassAnnotation(Class<?> cl)
getClassAnnotation
in class RMIClassLoaderSpi
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |