Class ExecutableArchiveLauncher
java.lang.Object
org.springframework.boot.loader.launch.Launcher
org.springframework.boot.loader.launch.ExecutableArchiveLauncher
- Direct Known Subclasses:
JarLauncher
,WarLauncher
Base class for a
Launcher
backed by an executable archive.- Since:
- 3.2.0
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ClassLoader
createClassLoader
(Collection<URL> urls) Create a classloader for the specified archives.protected final Archive
Return the archive being launched ornull
if there is no archive.Returns the archives that will be used to construct the class path.protected abstract String
Return the path prefix for relevant entries in the archive.protected String
Returns the main class that should be launched.protected abstract boolean
Determine if the specified entry is a nested item that should be added to the classpath.protected boolean
isSearchedDirectory
(Archive.Entry entry) Determine if the specified directory entry is a candidate for further searching.Methods inherited from class org.springframework.boot.loader.launch.Launcher
isExploded, launch, launch
-
Field Details
-
BOOT_CLASSPATH_INDEX_ATTRIBUTE
- See Also:
-
DEFAULT_CLASSPATH_INDEX_FILE_NAME
- See Also:
-
-
Constructor Details
-
Method Details
-
createClassLoader
Description copied from class:Launcher
Create a classloader for the specified archives.- Overrides:
createClassLoader
in classLauncher
- Parameters:
urls
- the classpath URLs- Returns:
- the classloader
- Throws:
Exception
- if the classloader cannot be created
-
getArchive
Description copied from class:Launcher
Return the archive being launched ornull
if there is no archive.- Specified by:
getArchive
in classLauncher
- Returns:
- the launched archive
-
getMainClass
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
-
getClassPathUrls
Description copied from class:Launcher
Returns the archives that will be used to construct the class path.- Specified by:
getClassPathUrls
in classLauncher
- Returns:
- the class path archives
- Throws:
Exception
- if the class path archives cannot be obtained
-
isSearchedDirectory
Determine if the specified directory entry is a candidate for further searching.- Parameters:
entry
- the entry to check- Returns:
true
if the entry is a candidate for further searching
-
isIncludedOnClassPath
Determine if the specified entry is a nested item that should be added to the classpath.- Parameters:
entry
- the entry to check- Returns:
true
if the entry is a nested item (jar or directory)
-
getEntryPathPrefix
Return the path prefix for relevant entries in the archive.- Returns:
- the entry path prefix
-