org.fuin.kickstart4j
Class Kickstart4J

java.lang.Object
  extended by org.fuin.kickstart4j.Kickstart4J

public final class Kickstart4J
extends Object

Main application.


Constructor Summary
Kickstart4J(Config config)
          Constructor with configuration.
 
Method Summary
static void displayCmdLineExceptionAndExit(CmdLineParser parser, CmdLineException ex, int exitCode)
          Shows an error message and exits the program with System.exit(..)
static void displayExceptionAndExit(Exception ex, int exitCode)
          Shows an error message and exits the program with System.exit(..)
 void execute()
          Executes the installer/updater.
 Kickstart4JListener getListener()
          Returns the life cycle listener.
static void main(String[] args)
          Main method used to start the installer/updater.
 void setListener(Kickstart4JListener listener)
          Sets the life cycle listener.
static void showMessageAndExit(String message, int exitCode)
          Shows a message and exits the program with System.exit(..)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Kickstart4J

public Kickstart4J(Config config)
Constructor with configuration.

Parameters:
config - Configuration to use.
Method Detail

getListener

public final Kickstart4JListener getListener()
Returns the life cycle listener.

Returns:
Listener - Always non-null.

setListener

public final void setListener(Kickstart4JListener listener)
Sets the life cycle listener.

Parameters:
listener - Listener - Will be set to a default listener if null.

execute

public final void execute()
                   throws org.fuin.utils4swing.dialogs.CanceledException,
                          InvalidConfigException
Executes the installer/updater.

Throws:
org.fuin.utils4swing.dialogs.CanceledException - The user canceled the installation.
InvalidConfigException - The configuration is invalid.

showMessageAndExit

public static void showMessageAndExit(String message,
                                      int exitCode)
Shows a message and exits the program with System.exit(..).

Parameters:
message - Message to display.
exitCode - System exit code.

displayCmdLineExceptionAndExit

public static void displayCmdLineExceptionAndExit(CmdLineParser parser,
                                                  CmdLineException ex,
                                                  int exitCode)
Shows an error message and exits the program with System.exit(..).

Parameters:
parser - Parser for usage display.
ex - Exception to display.
exitCode - System exit code.

displayExceptionAndExit

public static void displayExceptionAndExit(Exception ex,
                                           int exitCode)
Shows an error message and exits the program with System.exit(..).

Parameters:
ex - Exception to display.
exitCode - System exit code.

main

public static void main(String[] args)
Main method used to start the installer/updater. If you want to start it from another Java application you can simply use new Kickstart4J(kickstart4JConfig).execute() instead of calling this method.

Parameters:
args - Command line arguments.


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