public abstract class AbstractApplicationLaunch<G extends ApplicationConfig,C extends ApplicationContext>
extends java.lang.Object
ApplicationConfig
object is created from the command line parserApplicationContext
object is created from the ApplicationConfig
Modifier and Type | Field and Description |
---|---|
static int |
DO_NOT_EXIT |
static int |
EXIT_CODE_CLP_ERROR |
static int |
EXIT_CODE_LAUNCH_ERROR |
protected static boolean |
isTestMode |
Constructor and Description |
---|
AbstractApplicationLaunch(boolean hasGui,
G cfg) |
AbstractApplicationLaunch(boolean hasGui,
java.lang.String[] args) |
AbstractApplicationLaunch(G cfg) |
AbstractApplicationLaunch(java.lang.String[] args) |
Modifier and Type | Method and Description |
---|---|
protected abstract ApplicationCommandLineParser |
createCommandLineParser(java.lang.String[] args)
Creates the CommandLineParser instance for launching the application.
|
protected abstract C |
createContext(G cfg)
Creates the application context from the Config object.
|
protected IconKey |
createSplashIcon()
If an icon is provided it is being used for a splash screen while
launching a GUI application.
|
protected void |
doOnContextCreated(C launchedCtx) |
protected void |
doOnMainFrameCreated(C launchedCtx,
ZFrame frame) |
java.lang.Exception |
getError() |
C |
getLaunchedContext()
Makes the launched
ApplicationContext available to the outside world. |
ZFrame |
getLaunchedMainFrame()
Makes the launched main-frame available to the outside world.
|
protected void |
handleCommandLineError(ApplicationCommandLineParser clp,
java.lang.Exception e)
Calling this method terminates the VM.
|
protected void |
handleLaunchError(C ctx,
java.lang.Exception error)
Calling this method terminates the VM.
|
boolean |
hasError() |
boolean |
hasGui()
This method decides which type of application is launched.
|
void |
launch() |
protected void |
launchApplication(C ctx)
Must be implemented for running a non-GUI application
|
protected ZFrame |
launchMainFrame(C ctx)
Must be implemented for running a GUI application.
|
static void |
setTestMode(boolean isTest)
This method prevents the FatalErrorFrame to be popped up.
|
static void |
showFatalError(NlsKey title,
java.lang.Exception error,
int exitCode) |
static void |
showFatalError(NlsKey title,
java.lang.String errorMsg,
int exitCode) |
public static final int DO_NOT_EXIT
public static final int EXIT_CODE_CLP_ERROR
public static final int EXIT_CODE_LAUNCH_ERROR
protected static boolean isTestMode
public AbstractApplicationLaunch(G cfg)
public AbstractApplicationLaunch(boolean hasGui, G cfg)
public AbstractApplicationLaunch(java.lang.String[] args)
public AbstractApplicationLaunch(boolean hasGui, java.lang.String[] args)
public final void launch()
protected void doOnContextCreated(C launchedCtx)
protected void doOnMainFrameCreated(C launchedCtx, ZFrame frame) throws java.lang.Exception
java.lang.Exception
public C getLaunchedContext()
ApplicationContext
available to the outside world.public ZFrame getLaunchedMainFrame()
protected void launchApplication(C ctx) throws java.lang.Exception
java.lang.Exception
protected ZFrame launchMainFrame(C ctx) throws java.lang.Exception
java.lang.Exception
protected void handleCommandLineError(ApplicationCommandLineParser clp, java.lang.Exception e)
protected void handleLaunchError(C ctx, java.lang.Exception error)
public static void showFatalError(NlsKey title, java.lang.String errorMsg, int exitCode)
public static void showFatalError(NlsKey title, java.lang.Exception error, int exitCode)
public static void setTestMode(boolean isTest)
public java.lang.Exception getError()
public boolean hasError()
public final boolean hasGui()
protected IconKey createSplashIcon()
protected abstract C createContext(G cfg) throws java.lang.Exception
java.lang.Exception
protected abstract ApplicationCommandLineParser createCommandLineParser(java.lang.String[] args)
Copyright © 2014 EsprIT-Systems. All Rights Reserved.