| java.lang.Object org.jboss.mx.loading.ClassLoaderUtils
ClassLoaderUtils | public class ClassLoaderUtils (Code) | | Utility methods for class loader to package names, etc.
author: Scott.Stark@jboss.org version: $Revision: 57200 $ |
Inner Class :static class FileIterator | |
Inner Class :static class ClassPathEntry | |
Inner Class :static class ClassPathIterator | |
Method Summary | |
public static Set | clonePackageSet(Object toClone) | public static void | displayClassInfo(Class clazz, StringBuffer results) Format a string buffer containing the Class, Interfaces, CodeSource,
and ClassLoader information for the given object clazz. | public static URLClassLoader[] | getClassLoaderStack(ClassLoader cl) | public static URL[] | getClassLoaderURLs(ClassLoader cl) Use reflection to access a URL[] getURLs or URL[] getClasspath method so
that non-URLClassLoader class loaders, or class loaders that override
getURLs to return null or empty, can provide the true classpath info. | public static String | getJarClassName(String className) | public static String | getPackageName(String className) Parse a class name into its package prefix. | public static String | getResourceName(String className) Parse a class name into its resource form. | public static Set | newPackageSet() | public static String[] | updateClassNamesMap(RepositoryClassLoader cl, Map classNamesMap) Given a UCL this method determine what classes it contains
and create a mapping from the class names to the cl. | public static String[] | updateClassNamesMap(RepositoryClassLoader cl, Map classNamesMap, URL url, String[] prevClassNames) Augment the class names associated with a UCL. | static String[] | updateClassNamesMap(RepositoryClassLoader cl, Map classNamesMap, ClassPathIterator cpi, HashSet classNameSet) | public static String[] | updatePackageMap(RepositoryClassLoader cl, Map packagesMap) Given a UCL this method determine what packages
it contains and create a mapping from the package names to the cl. | public static String[] | updatePackageMap(RepositoryClassLoader cl, Map packagesMap, URL url, String[] prevPkgNames) Augment the package name associated with a UCL. | static String[] | updatePackageMap(RepositoryClassLoader cl, Map packagesMap, ClassPathIterator cpi, HashSet pkgNameSet) |
clonePackageSet | public static Set clonePackageSet(Object toClone)(Code) | | Clone a package set
Parameters: the - set to clone the cloned package set |
displayClassInfo | public static void displayClassInfo(Class clazz, StringBuffer results)(Code) | | Format a string buffer containing the Class, Interfaces, CodeSource,
and ClassLoader information for the given object clazz.
Parameters: clazz - the Class Parameters: results - - the buffer to write the info to |
getClassLoaderStack | public static URLClassLoader[] getClassLoaderStack(ClassLoader cl)(Code) | | Get all of the URLClassLoaders from cl on up the hierarchy
Parameters: cl - the class loader to start from The possibly empty array of URLClassLoaders from cl throughits parent class loaders |
getClassLoaderURLs | public static URL[] getClassLoaderURLs(ClassLoader cl)(Code) | | Use reflection to access a URL[] getURLs or URL[] getClasspath method so
that non-URLClassLoader class loaders, or class loaders that override
getURLs to return null or empty, can provide the true classpath info.
|
getJarClassName | public static String getJarClassName(String className)(Code) | | Translates a dot class name (java.lang.String) into a path form
suitable for a jar entry (java/lang/String.class)
Parameters: className - java.lang.String java/lang/String.class |
getPackageName | public static String getPackageName(String className)(Code) | | Parse a class name into its package prefix. This has to handle
array classes whose name is prefixed with [L.
|
getResourceName | public static String getResourceName(String className)(Code) | | Parse a class name into its resource form. This has to handle
array classes whose name is prefixed with [L.
|
newPackageSet | public static Set newPackageSet()(Code) | | Create a new package set
the new package set |
updateClassNamesMap | public static String[] updateClassNamesMap(RepositoryClassLoader cl, Map classNamesMap) throws Exception(Code) | | Given a UCL this method determine what classes it contains
and create a mapping from the class names to the cl.
Parameters: cl - the UCL that loads from url Parameters: classNamesMap - the Map to update the class names directly visible to the cl throws: Exception - |
updateClassNamesMap | public static String[] updateClassNamesMap(RepositoryClassLoader cl, Map classNamesMap, URL url, String[] prevClassNames) throws Exception(Code) | | Augment the class names associated with a UCL.
Parameters: cl - the UCL that loads from url Parameters: classNamesMap - the Map to update Parameters: url - the URL to parse for class names Parameters: prevClassNames - the set of pckage names already associated with cl the updated list of class names throws: Exception - |
updatePackageMap | public static String[] updatePackageMap(RepositoryClassLoader cl, Map packagesMap) throws Exception(Code) | | Given a UCL this method determine what packages
it contains and create a mapping from the package names to the cl.
Parameters: cl - the UCL that loads from url Parameters: packagesMap - the Map to update the updated unique set of package names throws: Exception - |
updatePackageMap | public static String[] updatePackageMap(RepositoryClassLoader cl, Map packagesMap, URL url, String[] prevPkgNames) throws Exception(Code) | | Augment the package name associated with a UCL.
Parameters: cl - the UCL that loads from url Parameters: packagesMap - the Map to update Parameters: url - the URL to parse for package names Parameters: prevPkgNames - the set of pckage names already associated with cl the updated unique set of package names throws: Exception - |
|
|