org.fuin.utils4swing.appstarter
Class AppStarter

java.lang.Object
  extended by org.fuin.utils4swing.appstarter.AppStarter

public final class AppStarter
extends java.lang.Object

Starts any application by injecting single jars, directories with jars or classpath directories into the classpath.


Constructor Summary
AppStarter(AppStarterConfig config)
          Constructor with configuration.
AppStarter(AppStarterConfig config, AppStarterListener listener)
          Constructor with configuration and listener.
 
Method Summary
 void execute()
          Starts the application.
static void main(java.lang.String[] args)
          Starts the application from the command line.
 void start(StartType startType, java.util.List<ClasspathEntry> classpathEntries, java.lang.String mainClass, java.util.List<java.lang.String> arguments)
          Injects entries in the classpath and starts the application.
static void start(StartType startType, java.util.List<ClasspathEntry> classpathEntries, java.lang.String mainClass, java.util.List<java.lang.String> arguments, AppStarterListener listener)
          Injects entries in the classpath and starts the application.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AppStarter

public AppStarter(AppStarterConfig config)
Constructor with configuration.

Parameters:
config - Configuration.

AppStarter

public AppStarter(AppStarterConfig config,
                  AppStarterListener listener)
Constructor with configuration and listener.

Parameters:
config - Configuration - Cannot be null.
listener - Listener to be notified when the application started.
Method Detail

start

public final void start(StartType startType,
                        java.util.List<ClasspathEntry> classpathEntries,
                        java.lang.String mainClass,
                        java.util.List<java.lang.String> arguments)
                 throws StartApplicationException
Injects entries in the classpath and starts the application.

Parameters:
startType - Start an application or an applet?
classpathEntries - Entries to inject into the classpath.
mainClass - Main class to start (applet class or class with main method).
arguments - Arguments for the application or the applet. Arguments for an applet must have the form "<key>=<value>".
Throws:
StartApplicationException - Application failed to start.

start

public static final void start(StartType startType,
                               java.util.List<ClasspathEntry> classpathEntries,
                               java.lang.String mainClass,
                               java.util.List<java.lang.String> arguments,
                               AppStarterListener listener)
                        throws StartApplicationException
Injects entries in the classpath and starts the application.

Parameters:
startType - Start an application or an applet?
classpathEntries - Entries to inject into the classpath.
mainClass - Main class to start (applet class or class with main method).
arguments - Arguments for the application or the applet. Arguments for an applet must have the form "<key>=<value>".
listener - Listener to be notified when the target application started.
Throws:
StartApplicationException - Application failed to start.

execute

public final void execute()
Starts the application.


main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Starts the application from the command line.

Parameters:
args - Command line arguments.
Throws:
java.lang.Exception - Start failed.


Copyright © 2011 Future Invent Informationsmanagement GmbH. All Rights Reserved.