com.aelitis.azureus.launcher
Class Launcher
java.lang.Object
com.aelitis.azureus.launcher.Launcher
public class Launcher
- extends Object
This will (hopefully) become a unified launching pathway covering everything
from the bare core over UIs to Launchable Plugins in the future
- Author:
- Aaron Grunthal
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Launcher
public Launcher()
launch
public static void launch(Class MainClass,
String[] args)
- Bootstraps a new
PrimaryClassloader
from the system class loader,
creates a new thread, instantiates MainClass and invokes its main method
with the provided arguments.
- Parameters:
MainClass
- class implementing the main() method which will be invokedargs
- arguments to the main method
checkAndLaunch
public static boolean checkAndLaunch(Class MainClass,
String[] args)
- Checks if the current classloader is not part of the
PeeringClassloader
hierarchy and performs launch(Class, String[])
if so
This example shows how to implement a main class that ensures that it is
called through the primary class loader:
MyClass {
public static void main(String[] args) {
if(Launcher.checkAndLaunch(MyClass.class,args))
return;
... // normal main code
}
}
- Parameters:
MainClass
- args
-
- Returns:
- true if bootstrapping was necessary and the main method was
called through a new classloader, false otherwise
isBootStrapped
public static boolean isBootStrapped()
- Returns:
- true if the current classloader is part of the
PeeringClassloader
hierarchy
getComponentLoader
public static SecondaryClassLoader getComponentLoader(URL[] urls)
main
public static void main(String[] args)