public abstract class Launcher
extends java.lang.Object
Archive
s.Constructor and Description |
---|
Launcher() |
Modifier and Type | Method and Description |
---|---|
protected Archive |
createArchive() |
protected java.lang.ClassLoader |
createClassLoader(java.util.Iterator<Archive> archives)
Create a classloader for the specified archives.
|
protected java.lang.ClassLoader |
createClassLoader(java.util.List<Archive> archives)
Deprecated.
since 2.3.0 for removal in 2.5.0 in favor of
createClassLoader(Iterator) |
protected java.lang.ClassLoader |
createClassLoader(java.net.URL[] urls)
Create a classloader for the specified URLs.
|
protected MainMethodRunner |
createMainMethodRunner(java.lang.String mainClass,
java.lang.String[] args,
java.lang.ClassLoader classLoader)
Create the
MainMethodRunner used to launch the application. |
protected Archive |
getArchive()
Return the root archive.
|
protected java.util.List<Archive> |
getClassPathArchives()
Deprecated.
since 2.3.0 for removal in 2.5.0 in favor of implementing
getClassPathArchivesIterator() . |
protected java.util.Iterator<Archive> |
getClassPathArchivesIterator()
Returns the archives that will be used to construct the class path.
|
protected abstract java.lang.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(java.lang.String[] args)
Launch the application.
|
protected void |
launch(java.lang.String[] args,
java.lang.String launchClass,
java.lang.ClassLoader classLoader)
Launch the application given the archive file and a fully configured classloader.
|
protected void launch(java.lang.String[] args) throws java.lang.Exception
public static void main(String[] args)
method.args
- the incoming argumentsjava.lang.Exception
- if the application fails to launch@Deprecated protected java.lang.ClassLoader createClassLoader(java.util.List<Archive> archives) throws java.lang.Exception
createClassLoader(Iterator)
archives
- the archivesjava.lang.Exception
- if the classloader cannot be createdprotected java.lang.ClassLoader createClassLoader(java.util.Iterator<Archive> archives) throws java.lang.Exception
archives
- the archivesjava.lang.Exception
- if the classloader cannot be createdprotected java.lang.ClassLoader createClassLoader(java.net.URL[] urls) throws java.lang.Exception
urls
- the URLsjava.lang.Exception
- if the classloader cannot be createdprotected void launch(java.lang.String[] args, java.lang.String launchClass, java.lang.ClassLoader classLoader) throws java.lang.Exception
args
- the incoming argumentslaunchClass
- the launch class to runclassLoader
- the classloaderjava.lang.Exception
- if the launch failsprotected MainMethodRunner createMainMethodRunner(java.lang.String mainClass, java.lang.String[] args, java.lang.ClassLoader classLoader)
MainMethodRunner
used to launch the application.mainClass
- the main classargs
- the incoming argumentsclassLoader
- the classloaderprotected abstract java.lang.String getMainClass() throws java.lang.Exception
java.lang.Exception
- if the main class cannot be obtainedprotected java.util.Iterator<Archive> getClassPathArchivesIterator() throws java.lang.Exception
java.lang.Exception
- if the class path archives cannot be obtained@Deprecated protected java.util.List<Archive> getClassPathArchives() throws java.lang.Exception
getClassPathArchivesIterator()
.java.lang.Exception
- if the class path archives cannot be obtainedprotected final Archive createArchive() throws java.lang.Exception
java.lang.Exception
protected boolean isExploded()
true
then only regular JARs are supported and the additional URL and
ClassLoader support infrastructure can be optimized.protected Archive getArchive()