|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--ks.jarloader.JarLoaderFacade
The JarLoaderFacade handles the loading of Classes from
mulitple jar files.
The jar files are treated as separate protection domains. Each protection
domain is defined by the String key passed in when the jar is
added. These keys must be unique. Files loaded through the delegation
mechanism(to the SystemClassLoader) will not be from separate domains.
jarLoader.JarLoader| Field Summary | |
protected java.util.Hashtable |
jarLoaders
|
| Constructor Summary | |
JarLoaderFacade()
|
|
| Method Summary | |
boolean |
activate()
Nothing to do. |
boolean |
addJar(java.lang.String key,
java.lang.String path,
java.lang.String jarName)
add a new jar file keyed with the String key. |
boolean |
connect(IBlock block,
java.lang.String interfaceName)
Has no required help. |
void |
deactivate()
Nothing to do. |
java.util.jar.Manifest |
getManifest(java.lang.String key)
Gets the Manifest for the Jar file associated with the given key. |
java.util.Enumeration |
getProvided()
Provides ILoader interface. |
java.util.Enumeration |
getRequired()
Nothing required. |
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. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected java.util.Hashtable jarLoaders
| Constructor Detail |
public JarLoaderFacade()
| Method Detail |
public boolean addJar(java.lang.String key,
java.lang.String path,
java.lang.String jarName)
throws java.io.FileNotFoundException
String key. 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.FileNotFoundExceptionpublic 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 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 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"
public boolean activate()
throws java.lang.Exception
java.lang.Exceptionedu.wpi.cs.cs509.cmi.interfaces.IBlock#activate()
public boolean connect(IBlock block,
java.lang.String interfaceName)
throws java.lang.Exception
java.lang.Exceptionedu.wpi.cs.cs509.cmi.interfaces.IBlock#connect(edu.wpi.cs.cs509.cmi.interfaces.IBlock,
java.lang.String)
public void deactivate()
throws java.lang.Exception
java.lang.Exceptionedu.wpi.cs.cs509.cmi.interfaces.IBlock#deactivate()public java.util.Enumeration getProvided()
edu.wpi.cs.cs509.cmi.interfaces.IBlock#getProvided()public java.util.Enumeration getRequired()
edu.wpi.cs.cs509.cmi.interfaces.IBlock#getRequired()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||