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
- Author:
- Phillip Webb, Andy Wilkinson, Madhura Bhave, Scott Frederick
- See Also:
-
Field Summary
Fields inherited from class org.springframework.boot.loader.launch.Launcher
BOOT_CLASSPATH_INDEX_ATTRIBUTE, classPathIndex, DEFAULT_CLASSPATH_INDEX_FILE_NAME
-
Constructor Summary
-
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 String
Returns the main class that should be launched.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
getEntryPathPrefix, isExploded, isIncludedOnClassPath, isIncludedOnClassPathAndNotIndexed, isLibraryFileOrClassesDirectory, launch, launch
-
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
-