站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss 4.0.1 sp1 system API Documentation 英文版文档

JBossRMIClassLoader (JBoss System API) - JBoss 4.0.1 sp1 system API Documentation 英文版文档


org.jboss.system
Class JBossRMIClassLoader

java.lang.Object
  extended byjava.rmi.server.RMIClassLoaderSpi
      extended byorg.jboss.system.JBossRMIClassLoader

public class JBossRMIClassLoader
extends RMIClassLoaderSpi

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.

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

Version:
$Revision: 1.4 $
Author:
Adrian Brock

Constructor Summary
JBossRMIClassLoader()
          Required constructor
 
Method Summary
 String getClassAnnotation(Class cl)
          Just delegate
 ClassLoader getClassLoader(String codebase)
          Just delegate
 Class loadClass(String codebase, String name, ClassLoader ignored)
          Just delegate
 Class loadProxyClass(String codebase, String[] interfaces, ClassLoader ignored)
          Ignore the JVM, use the thread context classloader for proxy caching
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JBossRMIClassLoader

public JBossRMIClassLoader()
Required constructor

Method Detail

loadProxyClass

public Class loadProxyClass(String codebase,
                            String[] interfaces,
                            ClassLoader ignored)
                     throws MalformedURLException,
                            ClassNotFoundException
Ignore the JVM, use the thread context classloader for proxy caching

Throws:
MalformedURLException
ClassNotFoundException

loadClass

public Class loadClass(String codebase,
                       String name,
                       ClassLoader ignored)
                throws MalformedURLException,
                       ClassNotFoundException
Just delegate

Throws:
MalformedURLException
ClassNotFoundException

getClassLoader

public ClassLoader getClassLoader(String codebase)
                           throws MalformedURLException
Just delegate

Throws:
MalformedURLException

getClassAnnotation

public String getClassAnnotation(Class cl)
Just delegate



Copyright © 2002 JBoss Group, LLC. All Rights Reserved.