Imported GNU Classpath 0.90
Imported GNU Classpath 0.90 * scripts/makemake.tcl: Set gnu/java/awt/peer/swing to ignore. * gnu/classpath/jdwp/VMFrame.java (SIZE): New constant. * java/lang/VMCompiler.java: Use gnu.java.security.hash.MD5. * java/lang/Math.java: New override file. * java/lang/Character.java: Merged from Classpath. (start, end): Now 'int's. (canonicalName): New field. (CANONICAL_NAME, NO_SPACES_NAME, CONSTANT_NAME): New constants. (UnicodeBlock): Added argument. (of): New overload. (forName): New method. Updated unicode blocks. (sets): Updated. * sources.am: Regenerated. * Makefile.in: Likewise. From-SVN: r111942
This commit is contained in:
parent
27079765d0
commit
8aa540d2f7
1367 changed files with 188789 additions and 22762 deletions
|
@ -38,10 +38,13 @@ exception statement from your version. */
|
|||
|
||||
package java.rmi.server;
|
||||
|
||||
import gnu.classpath.ServiceFactory;
|
||||
import gnu.classpath.SystemProperties;
|
||||
import gnu.java.rmi.server.RMIClassLoaderImpl;
|
||||
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.util.Iterator;
|
||||
|
||||
/**
|
||||
* This class provides a set of public static utility methods for supporting
|
||||
|
@ -84,6 +87,16 @@ public class RMIClassLoader
|
|||
return spi.loadClass(codebase, name, defaultLoader);
|
||||
}
|
||||
|
||||
public static Class loadProxyClass (String codeBase, String[] interfaces,
|
||||
ClassLoader defaultLoader)
|
||||
throws MalformedURLException, ClassNotFoundException
|
||||
{
|
||||
RMIClassLoaderSpi spi = getProviderInstance();
|
||||
if (spi == null)
|
||||
spi = getDefaultProviderInstance();
|
||||
return spi.loadProxyClass(codeBase, interfaces, defaultLoader);
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads a class from <code>codeBase</code>.
|
||||
*
|
||||
|
@ -171,7 +184,20 @@ public class RMIClassLoader
|
|||
*/
|
||||
private static RMIClassLoaderSpi getProviderInstance()
|
||||
{
|
||||
// TODO: Do something more useful here.
|
||||
return null;
|
||||
// If the user asked for the default, return it. We do a special
|
||||
// check here because our standard service lookup function does not
|
||||
// handle this -- nor should it.
|
||||
String prop = SystemProperties.getProperty("java.rmi.server.RMIClassLoaderSpi");
|
||||
if ("default".equals(prop))
|
||||
return null;
|
||||
Iterator it = ServiceFactory.lookupProviders(RMIClassLoaderSpi.class,
|
||||
null);
|
||||
if (it == null || ! it.hasNext())
|
||||
return null;
|
||||
// FIXME: the spec says we ought to throw an Error of some kind if
|
||||
// the specified provider is not suitable for some reason. However
|
||||
// our service factory simply logs the problem and moves on to the next
|
||||
// provider in this situation.
|
||||
return (RMIClassLoaderSpi) it.next();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue