类 Launcher
java.lang.Object
org.springframework.boot.loader.launch.Launcher
Base class for launchers that can start an application with a fully configured
classpath.
- 从以下版本开始:
- 3.2.0
- 作者:
- Phillip Webb, Dave Syer, Scott Frederick
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明protected ClassLoader
createClassLoader
(Collection<URL> urls) Create a classloader for the specified archives.protected abstract 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
Return the path prefix for relevant entries in the archive.protected abstract String
Returns the main class that should be launched.protected boolean
Returns if the launcher is running in an exploded mode.protected boolean
Determine if the specified entry is a nested item that should be added to the classpath.protected boolean
protected boolean
protected void
launch
(ClassLoader classLoader, String mainClassName, String[] args) Launch the application given the archive file and a fully configured classloader.protected void
Launch the application.
-
字段详细资料
-
BOOT_CLASSPATH_INDEX_ATTRIBUTE
- 另请参阅:
-
DEFAULT_CLASSPATH_INDEX_FILE_NAME
- 另请参阅:
-
classPathIndex
protected org.springframework.boot.loader.launch.ClassPathIndexFile classPathIndex
-
-
构造器详细资料
-
Launcher
public Launcher()
-
-
方法详细资料
-
launch
Launch the application. This method is the initial entry point that should be called by a subclasspublic static void main(String[] args)
method.- 参数:
args
- the incoming arguments- 抛出:
Exception
- if the application fails to launch
-
createClassLoader
Create a classloader for the specified archives.- 参数:
urls
- the classpath URLs- 返回:
- the classloader
- 抛出:
Exception
- if the classloader cannot be created
-
launch
protected void launch(ClassLoader classLoader, String mainClassName, String[] args) throws Exception Launch the application given the archive file and a fully configured classloader.- 参数:
classLoader
- the classloadermainClassName
- the main class to runargs
- the incoming arguments- 抛出:
Exception
- if the launch fails
-
isExploded
protected boolean isExploded()Returns if the launcher is running in an exploded mode. If this method returnstrue
then only regular JARs are supported and the additional URL and ClassLoader support infrastructure can be optimized.- 返回:
- if the jar is exploded.
-
getArchive
Return the archive being launched ornull
if there is no archive.- 返回:
- the launched archive
-
getMainClass
Returns the main class that should be launched.- 返回:
- the name of the main class
- 抛出:
Exception
- if the main class cannot be obtained
-
getClassPathUrls
Returns the archives that will be used to construct the class path.- 返回:
- the class path archives
- 抛出:
Exception
- if the class path archives cannot be obtained
-
getEntryPathPrefix
Return the path prefix for relevant entries in the archive.- 返回:
- the entry path prefix
-
isIncludedOnClassPath
Determine if the specified entry is a nested item that should be added to the classpath.- 参数:
entry
- the entry to check- 返回:
true
if the entry is a nested item (jar or directory)
-
isLibraryFileOrClassesDirectory
-
isIncludedOnClassPathAndNotIndexed
-