|
Last update: 2011-06-23 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.ClassLoader
org.proteios.util.JarClassLoader
public final class JarClassLoader
A class loader implementation that loads classes from JAR files. Each JAR
file requires a separate instance of this class. Use the
getInstance(String) method to get an existing or create a new
instance for a specific JAR file. If the classes in the JAR file requires
other classes in another JAR file to work, the paths to those JAR files must
be listed in the Class-Path attribute in the
META-INF/MANIFEST.MF file. For example:
Manifest-Version: 1.0 Class-Path: OtherJarPlugin.jarIf more than one JAR is needed separate them with one or more spaces. Note! It is only the
Class-Path entry for the JAR file passed to the
getInstance(String) method that is checked. The manifest file is not
checked for the other JARs.
| Method Summary | |
|---|---|
static boolean |
exists(String jarPath)
Check if a class loader for the given JAR file exists. |
protected Class<?> |
findClass(String name)
|
protected URL |
findResource(String name)
|
static ClassLoader |
getInstance(String jarPath)
Get a class loader for the specified JAR file. |
static void |
unload(String jarPath)
Unload the class loader for the given JAR file. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static final ClassLoader getInstance(String jarPath)
throws IOException
jarPath - The path to a JAR file
IOException - If the jar file can't be loadedpublic static final void unload(String jarPath)
getInstance(String) method is called again, a new class loader
instance will be created.
jarPath - The path to the JAR filepublic static final boolean exists(String jarPath)
jarPath - The path to the JAR file
protected Class<?> findClass(String name)
throws ClassNotFoundException
findClass in class ClassLoaderClassNotFoundExceptionprotected URL findResource(String name)
findResource in class ClassLoader
|
Last update: 2011-06-23 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||