public abstract class Launcher extends Object
Archive
s.Constructor and Description |
---|
Launcher() |
Modifier and Type | Method and Description |
---|---|
protected Archive |
createArchive() |
protected ClassLoader |
createClassLoader(Iterator<Archive> archives)
Create a classloader for the specified archives.
|
protected ClassLoader |
createClassLoader(List<Archive> archives)
Deprecated.
since 2.3.0 in favor of
createClassLoader(Iterator) |
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 Archive |
getArchive()
Return the root archive.
|
protected List<Archive> |
getClassPathArchives()
Deprecated.
since 2.3.0 in favor of implementing
getClassPathArchivesIterator() . |
protected Iterator<Archive> |
getClassPathArchivesIterator()
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 boolean |
isExploded()
Returns if the launcher is running in an exploded mode.
|
protected void |
launch(String[] args)
Launch the application.
|
protected void |
launch(String[] args,
String launchClass,
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 launch@Deprecated protected ClassLoader createClassLoader(List<Archive> archives) throws Exception
createClassLoader(Iterator)
archives
- the archivesException
- if the classloader cannot be createdprotected ClassLoader createClassLoader(Iterator<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 launchClass, ClassLoader classLoader) throws Exception
args
- the incoming argumentslaunchClass
- the launch 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 Iterator<Archive> getClassPathArchivesIterator() throws Exception
Exception
- if the class path archives cannot be obtained@Deprecated protected List<Archive> getClassPathArchives() throws Exception
getClassPathArchivesIterator()
.Exception
- if the class path archives cannot be obtainedprotected boolean isExploded()
true
then only regular JARs are supported and the additional URL and
ClassLoader support infrastructure can be optimized.protected Archive getArchive()