com.aelitis.azureus.launcher
Class Launcher

java.lang.Object
  extended by 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

Constructor Summary
Launcher()
           
 
Method Summary
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:
static SecondaryClassLoader getComponentLoader(URL[] urls)
           
static boolean isBootStrapped()
           
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.
static void main(String[] args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Launcher

public Launcher()
Method Detail

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 invoked
args - 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)