Package org.springframework.boot.loader
Class ExecutableArchiveLauncher
- java.lang.Object
- org.springframework.boot.loader.Launcher
- org.springframework.boot.loader.ExecutableArchiveLauncher
- Direct Known Subclasses:
JarLauncher
,WarLauncher
public abstract class ExecutableArchiveLauncher extends Launcher
Base class for executable archiveLauncher
s.
Constructor Summary
Constructors Modifier Constructor Description ExecutableArchiveLauncher()
protected
ExecutableArchiveLauncher(Archive archive)
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected Archive
getArchive()
protected List<Archive>
getClassPathArchives()
Returns the archives that will be used to construct the class path.protected String
getMainClass()
Returns the main class that should be launched.protected abstract boolean
isNestedArchive(Archive.Entry entry)
Determine if the specifiedJarEntry
is a nested item that should be added to the classpath.protected void
postProcessClassPathArchives(List<Archive> archives)
Called to post-process archive entries before they are used.Methods inherited from class org.springframework.boot.loader.Launcher
createArchive, createClassLoader, createClassLoader, createMainMethodRunner, launch, launch
Constructor Detail
ExecutableArchiveLauncher
public ExecutableArchiveLauncher()
ExecutableArchiveLauncher
protected ExecutableArchiveLauncher(Archive archive)
Method Detail
getArchive
protected final Archive getArchive()
getMainClass
protected String getMainClass() throws Exception
Description copied from class:Launcher
Returns the main class that should be launched.- Specified by:
getMainClass
in classLauncher
- Returns:
- the name of the main class
- Throws:
Exception
- if the main class cannot be obtained
getClassPathArchives
protected List<Archive> getClassPathArchives() throws Exception
Description copied from class:Launcher
Returns the archives that will be used to construct the class path.- Specified by:
getClassPathArchives
in classLauncher
- Returns:
- the class path archives
- Throws:
Exception
- if the class path archives cannot be obtained
isNestedArchive
protected abstract boolean isNestedArchive(Archive.Entry entry)
Determine if the specifiedJarEntry
is a nested item that should be added to the classpath. The method is called once for each entry.- Parameters:
entry
- the jar entry- Returns:
true
if the entry is a nested item (jar or folder)
postProcessClassPathArchives
protected void postProcessClassPathArchives(List<Archive> archives) throws Exception
Called to post-process archive entries before they are used. Implementations can add and remove entries.- Parameters:
archives
- the archives- Throws:
Exception
- if the post processing fails