|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.ClassLoader com.croftsoft.core.lang.classloader.Boot
public class Boot
The Boot ClassLoader bootstraps a main class downloaded directly off of a web site. The argument to this program is the URL of the main class bytecode file. Any additional arguments are passed to the downloaded class.
The Boot class can be readily distributed to a wide audience since it is small and simple. With a little customization, it can be hard-coded to download from a particular URL. It can also be used as a "seed" class by having it invoke a persistent resource loader.
Constructor Summary | |
---|---|
Boot()
|
Method Summary | |
---|---|
void |
bootstrap(byte[] data,
String[] args)
Converts the data to a Class and then invokes its main(args) method. |
static byte[] |
downloadBytes(URL url)
Returns null upon failure. |
static InputStream |
downloadStream(URL url)
Returns null upon failure. |
static void |
invokeMain(Class c,
String[] args)
Uses reflection to invoke the main(args) method of a class. |
Class |
loadClass(String name,
boolean resolve)
Returns the Class of the given name. |
static void |
main(String[] args)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Boot()
Method Detail |
---|
public static void main(String[] args) throws Exception
Exception
public static byte[] downloadBytes(URL url)
public static InputStream downloadStream(URL url)
public static void invokeMain(Class c, String[] args) throws IllegalAccessException
IllegalAccessException
public void bootstrap(byte[] data, String[] args) throws IllegalAccessException
IllegalAccessException
public Class loadClass(String name, boolean resolve)
loadClass
in class ClassLoader
|
CroftSoft Javadoc | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |