public class ApplicationLauncher extends Object
"./lib").
See displayUsage() method for command line explanations.
This class is alone in one Maven project to be able to produce a jar containing only this class. It's because, it's better that all the jars of the application are in a single ClassLoader (the URLClassLoader setup by this class). So, to avoid class loading problems, it's better that the intermediate ClassLoader (the usual application ClassLoader) contains as less class as possible.
| Modifier and Type | Field and Description |
|---|---|
static String |
BASE_DIR_KEY |
static String |
EXTRA_PARAMS_KEY |
static String |
LAUNCHER_PROPERTIES_KEY |
static String |
LIB_PATH_KEY |
static String |
MAIN_CLASS_KEY |
static String |
RECURSIVE_LIB_SEARCH_KEY |
static String |
SHOW_HELP_KEY |
static String |
VERBOSE_KEY |
| Constructor and Description |
|---|
ApplicationLauncher(Properties cmdLineProperties)
Instantiate a launcher using the given 'library' directories.
|
| Modifier and Type | Method and Description |
|---|---|
File |
getBaseDir() |
void |
launchApplication()
Start given the application using the newly instantiated URLClassloader.
|
static void |
main(String[] args)
Parse the argument string to instantiate the
ApplicationLauncher and call startApplication on it. |
public static final String BASE_DIR_KEY
public static final String EXTRA_PARAMS_KEY
public static final String LAUNCHER_PROPERTIES_KEY
public static final String LIB_PATH_KEY
public static final String MAIN_CLASS_KEY
public static final String RECURSIVE_LIB_SEARCH_KEY
public static final String SHOW_HELP_KEY
public static final String VERBOSE_KEY
public ApplicationLauncher(Properties cmdLineProperties)
libDirectories - List of directories containing the jar files to add to the classpathverbose - When true, display verbose messages to System.outpublic File getBaseDir()
public void launchApplication()
throws Exception
Exceptionpublic static void main(String[] args)
ApplicationLauncher and call startApplication on it. displayUsage() method for command line explanations.Copyright © 2013. All Rights Reserved.