public class PropertiesLauncher extends Launcher
Launcher for archives with user-configured classpath and main class via a
 properties file. This model is often more flexible and more amenable to creating
 well-behaved OS-level services than a model based on executable jars.
 
 Looks in various places for a properties file to extract loader settings, defaulting to
 loader.properties either on the current classpath or in the current working
 directory. The name of the properties file can be changed by setting a System property
 loader.config.name (e.g. -Dloader.config.name=foo will look for
 foo.properties. If that file doesn't exist then tries
 loader.config.location (with allowed prefixes classpath: and
 file: or any valid URL). Once that file is located turns it into Properties and
 extracts optional values (which can also be provided overridden as System properties in
 case the file doesn't exist):
 
loader.path: a comma-separated list of directories (containing file
 resources and/or nested archives in *.jar or *.zip or archives) or archives to append
 to the classpath. BOOT-INF/classes,BOOT-INF/lib in the application archive are
 always usedloader.main: the main method to delegate execution to once the class loader
 is set up. No default, but will fall back to looking for a Start-Class in a
 MANIFEST.MF, if there is one in ${loader.home}/META-INF.| Modifier and Type | Field and Description | 
|---|---|
| static java.lang.String | ARGSProperties key for default command line arguments. | 
| static java.lang.String | CONFIG_LOCATIONProperties key for config file location (including optional classpath:, file: or
 URL prefix). | 
| static java.lang.String | CONFIG_NAMEProperties key for name of external configuration file (excluding suffix). | 
| static java.lang.String | HOMEProperties key for home directory. | 
| static java.lang.String | MAINProperties key for main class. | 
| static java.lang.String | PATHProperties key for classpath entries (directories possibly containing jars or
 jars). | 
| static java.lang.String | SET_SYSTEM_PROPERTIESProperties key for boolean flag (default false) which if set will cause the
 external configuration properties to be copied to System properties (assuming that
 is allowed by Java security). | 
| Constructor and Description | 
|---|
| PropertiesLauncher() | 
| Modifier and Type | Method and Description | 
|---|---|
| protected java.lang.ClassLoader | createClassLoader(java.util.Iterator<Archive> archives)Create a classloader for the specified archives. | 
| protected java.lang.String[] | getArgs(java.lang.String... args) | 
| protected java.util.Iterator<Archive> | getClassPathArchivesIterator()Returns the archives that will be used to construct the class path. | 
| protected java.io.File | getHomeDirectory() | 
| protected java.lang.String | getMainClass()Returns the main class that should be launched. | 
| static void | main(java.lang.String[] args) | 
| static java.lang.String | toCamelCase(java.lang.CharSequence string) | 
createArchive, createClassLoader, createClassLoader, createMainMethodRunner, getArchive, getClassPathArchives, isExploded, launch, launchpublic static final java.lang.String MAIN
Start-Class.public static final java.lang.String PATH
BOOT-INF/classes,BOOT-INF/lib in the application archive are always used.public static final java.lang.String HOME
loader path. Defaults to current working directory (
 ${user.dir}).public static final java.lang.String ARGS
public static final java.lang.String CONFIG_NAME
loader config location is
 provided instead.public static final java.lang.String CONFIG_LOCATION
public static final java.lang.String SET_SYSTEM_PROPERTIES
protected java.io.File getHomeDirectory()
protected java.lang.String[] getArgs(java.lang.String... args)
                              throws java.lang.Exception
java.lang.Exceptionprotected java.lang.String getMainClass()
                                 throws java.lang.Exception
LaunchergetMainClass in class Launcherjava.lang.Exception - if the main class cannot be obtainedprotected java.lang.ClassLoader createClassLoader(java.util.Iterator<Archive> archives) throws java.lang.Exception
LaunchercreateClassLoader in class Launcherarchives - the archivesjava.lang.Exception - if the classloader cannot be createdprotected java.util.Iterator<Archive> getClassPathArchivesIterator() throws java.lang.Exception
LaunchergetClassPathArchivesIterator in class Launcherjava.lang.Exception - if the class path archives cannot be obtainedpublic static void main(java.lang.String[] args)
                 throws java.lang.Exception
java.lang.Exceptionpublic static java.lang.String toCamelCase(java.lang.CharSequence string)