|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.glassfish.grizzly.http.server.util.ClassLoaderUtil
public class ClassLoaderUtil
Simple ClassLoader utility.
| Constructor Summary | |
|---|---|
ClassLoaderUtil()
|
|
| Method Summary | |
|---|---|
static java.lang.ClassLoader |
createClassloader(java.io.File libDir,
java.lang.ClassLoader cl)
Deprecated. removal candidate, never used |
static java.net.URLClassLoader |
createURLClassLoader(java.lang.String dirPath)
Construct a URLClassLoader based on a canonical file location. |
static java.net.URLClassLoader |
createURLClassLoader(java.lang.String location,
java.lang.ClassLoader parent)
Construct a URLClassLoader based on a canonical file location. |
static java.lang.Object |
load(java.lang.String clazzName)
Load a class using the current {link Thread#getContextClassLoader} |
static java.lang.Object |
load(java.lang.String clazzName,
java.lang.ClassLoader classLoader)
Load a class using the provided ClassLoader |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ClassLoaderUtil()
| Method Detail |
|---|
public static java.lang.ClassLoader createClassloader(java.io.File libDir,
java.lang.ClassLoader cl)
throws java.io.IOException
libDir - Directory with jars.cl - the parent ClassLoader, or null if none.
URLClassLoader that can load classes from a directory that
contains jar and zip files.
java.io.IOException - I/O fail
public static java.net.URLClassLoader createURLClassLoader(java.lang.String dirPath)
throws java.io.IOException
URLClassLoader based on a canonical file location.
dirPath - a canonical path location
URLClassLoader
java.io.IOException - I/O
java.net.MalformedURLException - Invalid URL
public static java.net.URLClassLoader createURLClassLoader(java.lang.String location,
java.lang.ClassLoader parent)
throws java.io.IOException
URLClassLoader based on a canonical file location.
location - a canonical path locationparent - ClassLoader to be used as parent for returned one.
URLClassLoader
java.io.IOException - I/O
java.net.MalformedURLException - Invalid URLpublic static java.lang.Object load(java.lang.String clazzName)
clazzName - The name of the class you want to load.
public static java.lang.Object load(java.lang.String clazzName,
java.lang.ClassLoader classLoader)
ClassLoader
clazzName - The name of the class you want to load.classLoader - A classloader to use for loading a class.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||