Spec-Zone .ru
спецификации, руководства, описания, API
|
|
JavaTM 2 Platform Std. Ed. v1.3.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.rmi.server.RMIClassLoader
RMIClassLoader
provides static methods for loading classes
from a network location (one or more URLs) and obtaining the location
from which an existing class can be loaded. These methods are used by
the RMI runtime when marshalling and unmarshalling classes of parameters
and return values.
Method Summary | |
static String |
getClassAnnotation(Class cl)
Returns the class annotation (representing the location for a class) that RMI will use to annotate the call stream when marshalling objects of the given class. |
static ClassLoader |
getClassLoader(String codebase)
Returns a class loader that loads classes from the given codebase URL path. |
static Object |
getSecurityContext(ClassLoader loader)
Deprecated. no replacement. As of the Java 2 platform v1.2, RMI no longer uses this method to obtain a class loader's security context. |
static Class |
loadClass(String name)
Deprecated. replaced by loadClass(String,String) method |
static Class |
loadClass(String codebase,
String name)
Loads a class from a codebase URL path. |
static Class |
loadClass(URL codebase,
String name)
Loads a class from a codebase URL. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static Class loadClass(String name) throws MalformedURLException, ClassNotFoundException
loadClass(String,String)
method
java.rmi.server.codebase
property.name
- the name of the class to loadClass
object representing the loaded classMalformedURLException
- if the system property java.rmi.server.codebase
contains an invalid URLClassNotFoundException
- if a definition for the class could not
be found at the codebase locationloadClass(String,String)
public static Class loadClass(URL codebase, String name) throws MalformedURLException, ClassNotFoundException
null
, then the Class
object returned is
equivalent to the Class
object returned by
RMIClassLoader.loadClass(name)
.codebase
- the URL to load the class fromname
- the name of the class to loadClass
object representing the loaded classMalformedURLException
- if the codebase
paramater
contains an invalid non-null URLClassNotFoundException
- if a definition for the class could not
be found at the specified URLpublic static Class loadClass(String codebase, String name) throws MalformedURLException, ClassNotFoundException
null
, then the Class
object returned is
equivalent to the Class
object returned by
RMIClassLoader.loadClass(name)
.codebase
- the list of space-separated URLs to load the class fromname
- the name of the class to loadClass
object representing the loaded classMalformedURLException
- if the codebase
paramater
contains an invalid non-null URLClassNotFoundException
- if a definition for the class could not
be found at the specified locationpublic static ClassLoader getClassLoader(String codebase) throws MalformedURLException, SecurityException
#loadClass(String,String)
method would use to load classes
from the given codebase. If a class loader with the same codebase URL
path already exists for RMI runtime, it will be returned; otherwise, a
new class loader will be created. If the given codebase is null, it
returns the class loader used to load classes via the
#loadClass(String)
method.codebase
- the list of space-separated URLs which the
the class loader will load classes fromMalformedURLException
- if the codebase
paramater
contains an invalid non-null URLSecurityException
- if the caller does not have permission to
connect to all of the URLs in codebase
URL pathpublic static String getClassAnnotation(Class cl)
cl
- the class to obtain the annotation forpublic static Object getSecurityContext(ClassLoader loader)
loader
- a class loader from which to get the security contextSecurityManager.getSecurityContext()
|
JavaTM 2 Platform Std. Ed. v1.3.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Java, Java 2D, and JDBC are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-2001 Sun Microsystems, Inc. 901 San Antonio Road
Palo Alto, California, 94303, U.S.A. All Rights Reserved.