|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectorg.freecompany.brimstone.main.Main
public class Main
| Field Summary | |
|---|---|
protected java.lang.String[] |
arguments
|
java.lang.String |
clazz
|
java.lang.String |
method
|
protected java.lang.ClassLoader |
parent
|
java.lang.String |
path
|
protected java.util.concurrent.atomic.AtomicBoolean |
restart
|
| Constructor Summary | |
|---|---|
Main()
|
|
| Method Summary | |
|---|---|
protected void |
configure(java.lang.String[] arguments)
|
static Runner |
getRunner()
|
static void |
main(java.lang.String[] arguments)
|
void |
restart()
Indicates the main that after the application thread terminates it should be restarted. |
void |
setArguments(java.lang.String[] arguments)
Provides arguments to be passed to the specified static run method. |
void |
setClass(java.lang.String clazz)
Sets the class name that the main will load as the entry point to the application. |
void |
setMethod(java.lang.String method)
Sets the method name used to start the application. |
void |
setParent(java.lang.ClassLoader parent)
Sets the ClassLoader this main should use as the parent of the ClassLoader that will be built
from the provided path. |
void |
setPath(java.lang.String path)
Comma-separated list of URL strings that the main will use to look up the Class and
Method instances used to load and run the wrapped application. |
void |
start()
Starts the application as described by the three attributes above. |
void |
uncaughtException(java.lang.Thread t,
java.lang.Throwable e)
The default exception handler will simply log a SEVERE level message
with the exception object. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public java.lang.String path
public java.lang.String clazz
public java.lang.String method
protected final java.util.concurrent.atomic.AtomicBoolean restart
protected java.lang.ClassLoader parent
protected java.lang.String[] arguments
| Constructor Detail |
|---|
public Main()
| Method Detail |
|---|
public static Runner getRunner()
public static void main(java.lang.String[] arguments)
throws java.lang.Exception
java.lang.Exception
protected void configure(java.lang.String[] arguments)
throws java.lang.ClassNotFoundException
java.lang.ClassNotFoundExceptionpublic void setPath(java.lang.String path)
RunnerURL strings that the main will use to look up the Class and
Method instances used to load and run the wrapped application. This set of
locations will also serve as the runtime classpath for the loaded application.
setPath in interface Runnerpath - a list of urls to load from.public void setClass(java.lang.String clazz)
Runner
setClass in interface Runnerclazz - class name of the main application.public void setMethod(java.lang.String method)
RunnerClass loaded by name from the clazz attribute.
setMethod in interface Runnermethod - name to invoke when starting the application.public void setParent(java.lang.ClassLoader parent)
RunnerClassLoader this main should use as the parent of the ClassLoader that will be built
from the provided path. This defaults to the classloader of the main implementation itself
and if it is overridden applications executed through this main may not to resolve and use
this management interface.
setParent in interface Runnerparent - the ClassLoader to be used as the parent of the application ClassLoader.public void setArguments(java.lang.String[] arguments)
Runner
setArguments in interface Runnerarguments - arguments for the main method.
public void start()
throws java.lang.ClassNotFoundException,
java.lang.NoSuchMethodException,
java.lang.IllegalAccessException,
java.net.URISyntaxException,
java.net.MalformedURLException,
java.io.IOException
Runner
start in interface Runnerjava.lang.ClassNotFoundException - if the specified class can not be found.
java.lang.NoSuchMethodException - the specified method is not a static method on the given class.
java.lang.IllegalAccessException - the provided class or method cannot be accessed from this application.
java.net.URISyntaxException - if a
java.net.MalformedURLException
java.io.IOExceptionpublic void restart()
Runner
restart in interface Runner
public void uncaughtException(java.lang.Thread t,
java.lang.Throwable e)
SEVERE level message
with the exception object.
uncaughtException in interface java.lang.Thread.UncaughtExceptionHandlert - the thread which caused the exception.e - the exception.
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||