类 Launcher
- java.lang.Object
- org.springframework.boot.loader.Launcher
构造器概要
构造器 构造器 说明 Launcher()
方法概要
所有方法 实例方法 抽象方法 具体方法 修饰符和类型 方法 说明 protected Archive
createArchive()
protected ClassLoader
createClassLoader(URL[] urls)
Create a classloader for the specified URLs.protected ClassLoader
createClassLoader(List<Archive> archives)
Create a classloader for the specified archives.protected MainMethodRunner
createMainMethodRunner(String mainClass, String[] args, ClassLoader classLoader)
Create theMainMethodRunner
used to launch the application.protected abstract List<Archive>
getClassPathArchives()
Returns the archives that will be used to construct the class path.protected abstract String
getMainClass()
Returns the main class that should be launched.protected void
launch(String[] args)
Launch the application.protected void
launch(String[] args, String mainClass, ClassLoader classLoader)
Launch the application given the archive file and a fully configured classloader.
构造器详细资料
Launcher
public Launcher()
方法详细资料
launch
protected void launch(String[] args) throws Exception
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
protected ClassLoader createClassLoader(List<Archive> archives) throws Exception
Create a classloader for the specified archives.- 参数:
archives
- the archives- 返回:
- the classloader
- 抛出:
Exception
- if the classloader cannot be created
createClassLoader
protected ClassLoader createClassLoader(URL[] urls) throws Exception
Create a classloader for the specified URLs.- 参数:
urls
- the URLs- 返回:
- the classloader
- 抛出:
Exception
- if the classloader cannot be created
launch
protected void launch(String[] args, String mainClass, ClassLoader classLoader) throws Exception
Launch the application given the archive file and a fully configured classloader.- 参数:
args
- the incoming argumentsmainClass
- the main class to runclassLoader
- the classloader- 抛出:
Exception
- if the launch fails
createMainMethodRunner
protected MainMethodRunner createMainMethodRunner(String mainClass, String[] args, ClassLoader classLoader)
Create theMainMethodRunner
used to launch the application.- 参数:
mainClass
- the main classargs
- the incoming argumentsclassLoader
- the classloader- 返回:
- the main method runner
getMainClass
protected abstract String getMainClass() throws Exception
Returns the main class that should be launched.- 返回:
- the name of the main class
- 抛出:
Exception
- if the main class cannot be obtained
getClassPathArchives
protected abstract List<Archive> getClassPathArchives() throws Exception
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
createArchive
protected final Archive createArchive() throws Exception
- 抛出:
Exception