LoaderHandler provides the implementation of the static
methods of the java.rmi.server.RMIClassLoader class.
| Modifier and Type | Field and Description |
|---|---|
| private static final Map | codebaseLoaders
table of class loaders that use codebase property for annotation |
| private static String | codebaseProperty
value of "java.rmi.server.codebase" property, as cached at class initialization time. |
| private static URL[] | codebaseURLs
list of URLs represented by the codebase property, if valid |
| pack-priv static final Log | |
| pack-priv static final int | logLevel
RMI class loader log level |
| private static final Map | pathToURLsCache
map from weak(key=string) to [URL[], soft(key)] |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public 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. |
| public static ClassLoader | |
| private static synchronized URL[] | getDefaultCodebaseURLs()
Returns an array of URLs initialized with the value of the java.rmi.server.codebase property as the URL path. |
| public static Class | loadClass(String codebase, String name, ClassLoader defaultLoader)
Load a class from a network location (one or more URLs), but first try to resolve the named class through the given "default loader". |
| private static Class | |
| public static Class | loadProxyClass(String codebase, String[] interfaces, ClassLoader defaultLoader)
Define and return a dynamic proxy class in a class loader with URLs supplied in the given location. |
| private static Class | loadProxyClass(String[] interfaceNames, ClassLoader defaultLoader, ClassLoader codebaseLoader, boolean preferCodebase)
Define a proxy class in the default loader if appropriate. |
| private static Class | loadProxyClass(ClassLoader loader, Class<?>[] interfaces)
Define a proxy class in the given class loader. |
| private static ClassLoader | loadProxyInterfaces(String[] interfaces, ClassLoader loader, Class<?>[] classObjs, boolean[] nonpublic)
|
| private static URL[] | pathToURLs(String path)
Convert a string containing a space-separated list of URLs into a corresponding array of URL objects, throwing a MalformedURLException if any of the URLs are invalid. |
| public static void | registerCodebaseLoader(ClassLoader loader)
Register a class loader as one whose classes should always be annotated with the value of the "java.rmi.server.codebase" property. |
| private static String | urlsToPath(URL[] urls)
Convert an array of URL objects into a corresponding string containing a space-separated list of URLs. |
| codebaseLoaders | back to summary |
|---|---|
| private static final Map<ClassLoader, Void> codebaseLoaders table of class loaders that use codebase property for annotation | |
| codebaseProperty | back to summary |
|---|---|
| private static String codebaseProperty value of "java.rmi.server.codebase" property, as cached at class initialization time. It may contain malformed URLs. | |
| codebaseURLs | back to summary |
|---|---|
| private static URL[] codebaseURLs list of URLs represented by the codebase property, if valid | |
| loaderLog | back to summary |
|---|---|
| pack-priv static final Log loaderLog | |
| logLevel | back to summary |
|---|---|
| pack-priv static final int logLevel RMI class loader log level | |
| pathToURLsCache | back to summary |
|---|---|
| private static final Map<String, Object[]> pathToURLsCache map from weak(key=string) to [URL[], soft(key)] | |
| LoaderHandler | back to summary |
|---|---|
| private LoaderHandler() | |
| getClassAnnotation | back to summary |
|---|---|
| public 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. | |
| getClassLoader | back to summary |
|---|---|
| public static ClassLoader getClassLoader(String codebase) throws MalformedURLException Returns the thread context classloader. The codebase argument is ignored. | |
| getDefaultCodebaseURLs | back to summary |
|---|---|
| private static synchronized URL[] getDefaultCodebaseURLs() throws MalformedURLException Returns an array of URLs initialized with the value of the java.rmi.server.codebase property as the URL path. | |
| loadClass | back to summary |
|---|---|
| public static Class Load a class from a network location (one or more URLs), but first try to resolve the named class through the given "default loader". | |
| loadClass | back to summary |
|---|---|
| private static Class Load a class from the RMI class loader corresponding to the given codebase URL path in the current execution context. | |
| loadProxyClass | back to summary |
|---|---|
| public static Class Define and return a dynamic proxy class in a class loader with URLs supplied in the given location. The proxy class will implement interface classes named by the given array of interface names. | |
| loadProxyClass | back to summary |
|---|---|
| private static Class Define a proxy class in the default loader if appropriate. Define the class in an RMI class loader otherwise. The proxy class will implement classes which are named in the supplied interfaceNames. | |
| loadProxyClass | back to summary |
|---|---|
| private static Class Define a proxy class in the given class loader. The proxy class will implement the given interfaces Classes. | |
| loadProxyInterfaces | back to summary |
|---|---|
| private static ClassLoader loadProxyInterfaces(String[] interfaces, ClassLoader loader, Class<?>[] classObjs, boolean[] nonpublic) throws ClassNotFoundException | |
| pathToURLs | back to summary |
|---|---|
| private static URL[] pathToURLs(String path) throws MalformedURLException Convert a string containing a space-separated list of URLs into a corresponding array of URL objects, throwing a MalformedURLException if any of the URLs are invalid. | |
| registerCodebaseLoader | back to summary |
|---|---|
| public static void registerCodebaseLoader(ClassLoader loader) Register a class loader as one whose classes should always be annotated with the value of the "java.rmi.server.codebase" property. | |
| urlsToPath | back to summary |
|---|---|
| private static String urlsToPath(URL[] urls) Convert an array of URL objects into a corresponding string containing a space-separated list of URLs. Note that if the array has zero elements, the return value is null, not the empty string. | |