|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.lang.ClassLoader
java.security.SecureClassLoader
java.net.URLClassLoader
org.formaria.editor.project.registry.JarClassLoader
public class JarClassLoader
A class loader for loading jar files, both local and remote.
| Field Summary | |
|---|---|
static java.util.jar.Attributes.Name |
Attributes_Name_JAVA_BEAN
|
static java.util.jar.Attributes.Name |
Attributes_Name_NAME
|
| Constructor Summary | |
|---|---|
JarClassLoader(java.net.URL url)
Creates a new JarClassLoader for the specified url. |
|
JarClassLoader(java.net.URL url,
java.lang.ClassLoader parent)
Creates a new JarClassLoader for the specified url. |
|
| Method Summary | |
|---|---|
void |
addJarFile(java.lang.String jarfile)
Adds a jar file from the filesystems into the jar loader list. |
void |
addJarFile(java.net.URL url)
Adds the jar file with the following url into the class loader. |
static JarClassLoader |
getJarClassLoader()
Returns the shared instance of the class loader. |
java.lang.String |
getMainClassName()
Returns the name of the jar file main class, or null if no "Main-Class" manifest attributes was defined. |
void |
invokeClass(java.lang.String name,
java.lang.String[] args)
Invokes the application in this jar file given the name of the main class and an array of arguments. |
static void |
setJarClassLoader(JarClassLoader cl)
Sets the static instance of the class loader. |
| Methods inherited from class java.net.URLClassLoader |
|---|
addURL, definePackage, findClass, findResource, findResources, getPermissions, getURLs, newInstance, newInstance |
| Methods inherited from class java.security.SecureClassLoader |
|---|
defineClass, defineClass |
| Methods inherited from class java.lang.ClassLoader |
|---|
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findSystemClass, getPackage, getPackages, getParent, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, loadClass, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.util.jar.Attributes.Name Attributes_Name_JAVA_BEAN
public static final java.util.jar.Attributes.Name Attributes_Name_NAME
| Constructor Detail |
|---|
public JarClassLoader(java.net.URL url)
url - The url of the jar file i.e. http://www.xxx.yyy/jarfile.jar
or file:c:\foo\lib\testbeans.jar
public JarClassLoader(java.net.URL url,
java.lang.ClassLoader parent)
url - The url of the jar file i.e. http://www.xxx.yyy/jarfile.jar
or file:c:\foo\lib\testbeans.jarparent - the parent classloader| Method Detail |
|---|
public void addJarFile(java.net.URL url)
url - The url of the jar file i.e. http://www.xxx.yyy/jarfile.jar
or file:c:\foo\lib\testbeans.jarpublic void addJarFile(java.lang.String jarfile)
jarfile - The full path to the jar file.public static JarClassLoader getJarClassLoader()
public static void setJarClassLoader(JarClassLoader cl)
public java.lang.String getMainClassName()
throws java.io.IOException
java.io.IOException
public void invokeClass(java.lang.String name,
java.lang.String[] args)
throws java.lang.ClassNotFoundException,
java.lang.NoSuchMethodException,
java.lang.reflect.InvocationTargetException
name - the name of the main classargs - the arguments for the application
java.lang.ClassNotFoundException - if the specified class could not
be found
java.lang.NoSuchMethodException - if the specified class does not
contain a "main" method
java.lang.reflect.InvocationTargetException - if the application raised an
exception
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||