org.codehaus.classworlds
Class EmbeddedLauncher
public class EmbeddedLauncher
Command-line invokable application launcher.
This launcher class assists in the creation of classloaders and
ClassRealm
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
.
$Id: EmbeddedLauncher.java 78 2004-07-01 13:59:13Z jvanzyl $
configure , getEnhancedMainMethod , getExitCode , getMainClass , getMainClassName , getMainMethod , getMainRealm , getMainRealmName , getSystemClassLoader , getWorld , launch , launchEnhanced , launchStandard , main , mainWithExitCode , setAppMain , setSystemClassLoader , setWorld |
EmbeddedLauncher
public EmbeddedLauncher()
getEnhancedMainMethod
protected Method getEnhancedMainMethod()
throws ClassNotFoundException,
NoSuchMethodException,
NoSuchRealmException
Retrieve the enhanced main entry method.
- getEnhancedMainMethod in interface Launcher
- The enhanced main entry method.
getMainClassName
public String getMainClassName()
Retrieve the main entry class name.
- getMainClassName in interface Launcher
- The main entry class name.
getMainRealmName
public String getMainRealmName()
Retrieve the main entry realm name.
- getMainRealmName in interface Launcher
- The main entry realm name.
launch
public void launch()
throws Exception
launchX
protected void launchX()
throws ClassNotFoundException,
IllegalAccessException,
InvocationTargetException,
NoSuchMethodException,
NoSuchRealmException
Attempt to launch the application through the enhanced main method.
This will seek a method with the exact signature of:
public static void main(String[] args, ClassWorld world)
setAppMain
public void setAppMain(String mainClassName,
String mainRealmName)
Set the application's main entrypoint.
- setAppMain in interface Launcher
mainClassName
- The main class name.mainRealmName
- The realm to load the class from.