public abstract class Launcher extends Object
Archive
s.Constructor and Description |
---|
Launcher() |
Modifier and Type | Method and Description |
---|---|
protected Archive |
createArchive() |
protected ClassLoader |
createClassLoader(List<Archive> archives)
Create a classloader for the specified archives.
|
protected ClassLoader |
createClassLoader(URL[] urls)
Create a classloader for the specified URLs.
|
protected MainMethodRunner |
createMainMethodRunner(String mainClass,
String[] args,
ClassLoader classLoader)
Create the
MainMethodRunner used to launch the application. |
protected abstract List<Archive> |
getClassPathArchives()
Returns the archives that will be used to construct the class path.
|
protected abstract String |
getMainClass()
Returns the main class that should be launched.
|
protected void |
launch(String[] args)
Launch the application.
|
protected void |
launch(String[] args,
String mainClass,
ClassLoader classLoader)
Launch the application given the archive file and a fully configured classloader.
|
protected void launch(String[] args) throws Exception
public static void main(String[] args)
method.args
- the incoming argumentsException
- if the application fails to launchprotected ClassLoader createClassLoader(List<Archive> archives) throws Exception
archives
- the archivesException
- if the classloader cannot be createdprotected ClassLoader createClassLoader(URL[] urls) throws Exception
urls
- the URLsException
- if the classloader cannot be createdprotected void launch(String[] args, String mainClass, ClassLoader classLoader) throws Exception
args
- the incoming argumentsmainClass
- the main class to runclassLoader
- the classloaderException
- if the launch failsprotected MainMethodRunner createMainMethodRunner(String mainClass, String[] args, ClassLoader classLoader)
MainMethodRunner
used to launch the application.mainClass
- the main classargs
- the incoming argumentsclassLoader
- the classloaderprotected abstract String getMainClass() throws Exception
Exception
- if the main class cannot be obtainedprotected abstract List<Archive> getClassPathArchives() throws Exception
Exception
- if the class path archives cannot be obtainedCopyright © 2021 Pivotal Software, Inc.. All rights reserved.