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 ClassLoadercreateClassLoader(Collection<URL> urls) Create a classloader for the specified archives.protected final ArchiveReturn the archive being launched ornullif there is no archive.Returns the archives that will be used to construct the class path.protected abstract StringReturn the path prefix for relevant entries in the archive.protected StringReturns the main class that should be launched.protected abstract booleanDetermine if the specified entry is a nested item that should be added to the classpath.protected booleanisSearchedDirectory(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:LauncherCreate a classloader for the specified archives.- Overrides:
createClassLoaderin classLauncher- Parameters:
urls- the classpath URLs- Returns:
- the classloader
- Throws:
Exception- if the classloader cannot be created
-
getArchive
Description copied from class:LauncherReturn the archive being launched ornullif there is no archive.- Specified by:
getArchivein classLauncher- Returns:
- the launched archive
-
getMainClass
Description copied from class:LauncherReturns the main class that should be launched.- Specified by:
getMainClassin classLauncher- Returns:
- the name of the main class
- Throws:
Exception- if the main class cannot be obtained
-
getClassPathUrls
Description copied from class:LauncherReturns the archives that will be used to construct the class path.- Specified by:
getClassPathUrlsin 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:
trueif 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:
trueif 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
-