public class EmbeddedLauncher extends Launcher
ClassRealms
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.
CLASSWORLDS_CONF, mainClassName, mainRealmName, systemClassLoader, UBERJAR_CONF_DIR, world| Constructor and Description |
|---|
EmbeddedLauncher() |
| Modifier and Type | Method and Description |
|---|---|
protected Method |
getEnhancedMainMethod()
Retrieve the enhanced main entry method.
|
Class |
getMainClass()
Retrieve the main entry class.
|
String |
getMainClassName()
Retrieve the main entry class name.
|
ClassRealm |
getMainRealm()
Retrieve the main entry realm.
|
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(String mainClassName,
String mainRealmName)
Set the application's main entrypoint.
|
configure, getExitCode, getMainMethod, getSystemClassLoader, getWorld, launch, launchEnhanced, launchStandard, main, mainWithExitCode, setSystemClassLoader, setWorldpublic void setAppMain(String mainClassName, String mainRealmName)
setAppMain in class LaunchermainClassName - The main class name.mainRealmName - The realm to load the class from.public String getMainRealmName()
getMainRealmName in class Launcherpublic String getMainClassName()
getMainClassName in class Launcherpublic Class getMainClass() throws ClassNotFoundException, NoSuchRealmException
getMainClass in class LauncherClassNotFoundException - If the class cannot be found.NoSuchRealmException - If the specified main entry realm does not exist.public ClassRealm getMainRealm() throws NoSuchRealmException
getMainRealm in class LauncherNoSuchRealmException - If the specified main entry realm does not exist.protected Method getEnhancedMainMethod() throws ClassNotFoundException, NoSuchMethodException, NoSuchRealmException
getEnhancedMainMethod in class LauncherClassNotFoundException - If the main entry class cannot be found.NoSuchMethodException - If the main entry method cannot be found.NoSuchRealmException - If the main entry realm cannot be found.protected void launchX()
throws ClassNotFoundException,
IllegalAccessException,
InvocationTargetException,
NoSuchMethodException,
NoSuchRealmException
public static void main(String[] args, ClassWorld world)
ClassNotFoundException - If the main entry class cannot be found.IllegalAccessException - If the method cannot be accessed.InvocationTargetException - If the target of the invokation is
invalid.NoSuchMethodException - If the main entry method cannot be found.NoSuchRealmException - If the main entry realm cannot be found.Copyright © 2002–2017 The Codehaus. All rights reserved.