|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Enables dynamic loading of classes.
Method Summary | |
boolean |
addJar(java.lang.String key,
java.lang.String path,
java.lang.String jarName)
add a new jar file keyed with the String key. |
java.util.jar.Manifest |
getManifest(java.lang.String key)
Gets the Manifest for the Jar file associated with the given key. |
java.lang.Class |
loadClass(java.lang.String key,
java.lang.String className)
Loads the named class from the JarLoader associated with
the specified key. |
void |
removeJar(java.lang.String key,
java.lang.String jarName)
remove the JarLoader keyed with the String key if it
indeed loads files for the named jar file. |
Method Detail |
public boolean addJar(java.lang.String key, java.lang.String path, java.lang.String jarName) throws java.io.FileNotFoundException
String
key. Future
calls to loadClass( String key, String className ) will load jars
from this jar file.
key
- used to reference this jar file.jarName
- the name of the jar file to be loaded e.g. "classes.jar"path
- the path to the jar file. e.g. "jar/storage/"*
java.io.FileNotFoundException
public java.lang.Class loadClass(java.lang.String key, java.lang.String className) throws java.lang.ClassNotFoundException
JarLoader
associated with
the specified key.
key
- the identifier of the JarLoader to use for loading.className
- the name of the Class
to load.
Class
named or null if no
JarLoader
is associated with the key.
java.lang.ClassNotFoundException
public java.util.jar.Manifest getManifest(java.lang.String key)
key
- the identifier of the JarLoader to use for loading.
Manifest
for the named JarFile or null if not
found.public void removeJar(java.lang.String key, java.lang.String jarName)
String
key if it
indeed loads files for the named jar file.
After successfully removing the JarLoader, files from the named jarFile will no longer be loadable through this class. However, if Classes exist which were created by the removed jarLoader they can still load classes from it.
key
- used to reference this jar file.jarName
- the name of the jar file to be removed e.g. "classes.jar"
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |