|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.codehaus.classworlds.Launcher
org.codehaus.classworlds.EmbeddedLauncher
public class EmbeddedLauncher
Command-line invokable application launcher.
This launcher class assists in the creation of classloaders andClassRealm
s
from a configuration file and the launching of the application's main
method from the correct class loaded through the correct classloader.
The path to the configuration file is specified using the classworlds.conf
system property, typically specified using the -D
switch to
java
.
Field Summary |
---|
Fields inherited from class org.codehaus.classworlds.Launcher |
---|
CLASSWORLDS_CONF, mainClassName, mainRealmName, systemClassLoader, UBERJAR_CONF_DIR, world |
Constructor Summary | |
---|---|
EmbeddedLauncher()
|
Method Summary | |
---|---|
protected java.lang.reflect.Method |
getEnhancedMainMethod()
Retrieve the enhanced main entry method. |
java.lang.Class |
getMainClass()
Retrieve the main entry class. |
java.lang.String |
getMainClassName()
Retrieve the main entry class name. |
ClassRealm |
getMainRealm()
Retrieve the main entry realm. |
java.lang.String |
getMainRealmName()
Retrieve the main entry realm name. |
void |
launch()
|
protected void |
launchX()
Attempt to launch the application through the enhanced main method. |
void |
setAppMain(java.lang.String mainClassName,
java.lang.String mainRealmName)
Set the application's main entrypoint. |
Methods inherited from class org.codehaus.classworlds.Launcher |
---|
configure, getExitCode, getMainMethod, getSystemClassLoader, getWorld, launch, launchEnhanced, launchStandard, main, mainWithExitCode, setSystemClassLoader, setWorld |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public EmbeddedLauncher()
Method Detail |
---|
public void setAppMain(java.lang.String mainClassName, java.lang.String mainRealmName)
setAppMain
in class Launcher
mainClassName
- The main class name.mainRealmName
- The realm to load the class from.public java.lang.String getMainRealmName()
getMainRealmName
in class Launcher
public java.lang.String getMainClassName()
getMainClassName
in class Launcher
public java.lang.Class getMainClass() throws java.lang.ClassNotFoundException, NoSuchRealmException
getMainClass
in class Launcher
java.lang.ClassNotFoundException
- If the class cannot be found.
NoSuchRealmException
- If the specified main entry realm does not exist.public ClassRealm getMainRealm() throws NoSuchRealmException
getMainRealm
in class Launcher
NoSuchRealmException
- If the specified main entry realm does not exist.protected java.lang.reflect.Method getEnhancedMainMethod() throws java.lang.ClassNotFoundException, java.lang.NoSuchMethodException, NoSuchRealmException
getEnhancedMainMethod
in class Launcher
java.lang.ClassNotFoundException
- If the main entry class cannot be found.
java.lang.NoSuchMethodException
- If the main entry method cannot be found.
NoSuchRealmException
- If the main entry realm cannot be found.protected void launchX() throws java.lang.ClassNotFoundException, java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException, java.lang.NoSuchMethodException, NoSuchRealmException
public static void main(String[] args, ClassWorld world)
java.lang.ClassNotFoundException
- If the main entry class cannot be found.
java.lang.IllegalAccessException
- If the method cannot be accessed.
java.lang.reflect.InvocationTargetException
- If the target of the invokation is
invalid.
java.lang.NoSuchMethodException
- If the main entry method cannot be found.
NoSuchRealmException
- If the main entry realm cannot be found.public void launch() throws java.lang.Exception
java.lang.Exception
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |