Methods Summary |
---|
public static java.lang.String | getLocalCodebase()Get local codebase System property (java.rmi.server.codebase).
May be null or a space separated array of URLS.
return localCodebase;
|
public static java.lang.Class | loadClass(java.lang.String className, java.lang.String remoteCodebase, java.lang.ClassLoader loader)Returns a class instance for the specified class.
if (loader == null) {
return loadClassM(className,remoteCodebase,useCodebaseOnly);
} else {
try {
return loadClassM(className,remoteCodebase,useCodebaseOnly);
} catch (ClassNotFoundException e) {
return loader.loadClass(className);
}
}
|
public static java.lang.Class | loadClass(java.lang.String className, java.lang.String remoteCodebase)Returns a class instance for the specified class.
return loadClass(className,remoteCodebase,null);
|
public static java.lang.Class | loadClass(java.lang.String className)Returns a class instance for the specified class.
return loadClass(className,null,null);
|
private static java.lang.Class | loadClassM(java.lang.String className, java.lang.String remoteCodebase, boolean useCodebaseOnly)
try {
return JDKClassLoader.loadClass(null,className);
} catch (ClassNotFoundException e) {}
try {
if (!useCodebaseOnly && remoteCodebase != null) {
return RMIClassLoader.loadClass(remoteCodebase,
className);
} else {
return RMIClassLoader.loadClass(className);
}
} catch (MalformedURLException e) {
className = className + ": " + e.toString();
}
throw new ClassNotFoundException(className);
|
public static final void | main(java.lang.String[] args)
setCodebaseProperties();
System.out.println("1.2 VM");
/*
// If on 1.2, use a policy with all permissions.
System.setSecurityManager (new javax.rmi.download.SecurityManager());
String targetClass = "[[Lrmic.Typedef;";
System.out.println("localCodebase = "+localCodebase);
System.out.println("Trying to load "+targetClass);
try {
Class clz = loadClass(targetClass,null,localCodebase);
System.out.println("Loaded: "+clz);
} catch (ClassNotFoundException e) {
System.out.println("Caught "+e);
}
*/
|
public static synchronized void | setCodebaseProperties()Set the codebase and useCodebaseOnly properties. This is public
only for test code.
String prop = (String)AccessController.doPrivileged(
new GetPropertyAction(LOCAL_CODEBASE_KEY)
);
if (prop != null && prop.trim().length() > 0) {
localCodebase = prop;
}
prop = (String)AccessController.doPrivileged(
new GetPropertyAction(USE_CODEBASE_ONLY_KEY)
);
if (prop != null && prop.trim().length() > 0) {
useCodebaseOnly = Boolean.valueOf(prop).booleanValue();
}
|
public static synchronized void | setLocalCodebase(java.lang.String codebase)Set the default code base. This method is here only
for test code.
localCodebase = codebase;
|
public static boolean | useCodebaseOnly()Return true if the system property "java.rmi.server.useCodebaseOnly"
is set, false otherwise.
return useCodebaseOnly;
|