类 SpringApplicationLauncher
- java.lang.Object
- org.springframework.boot.cli.app.SpringApplicationLauncher
public class SpringApplicationLauncher extends Object
A launcher forSpringApplication
or aSpringApplication
subclass. The class that is used can be configured using the System propertyspring.application.class.name
or theSPRING_APPLICATION_CLASS_NAME
environment variable. Uses reflection to allow the launching code to exist in a separate ClassLoader from the application code.- 从以下版本开始:
- 1.2.0
- 另请参阅:
System.getProperty(String)
,System.getenv(String)
构造器概要
构造器 构造器 说明 SpringApplicationLauncher(ClassLoader classLoader)
Creates a new launcher that will use the givenclassLoader
to load the configuredSpringApplication
class.
构造器详细资料
SpringApplicationLauncher
public SpringApplicationLauncher(ClassLoader classLoader)
Creates a new launcher that will use the givenclassLoader
to load the configuredSpringApplication
class.- 参数:
classLoader
- theClassLoader
to use
方法详细资料
launch
public Object launch(Class<?>[] sources, String[] args) throws Exception
Launches the application created using the givensources
. The application is launched with the givenargs
.- 参数:
sources
- the sources for the applicationargs
- the args for the application- 返回:
- the application's
ApplicationContext
- 抛出:
Exception
- if the launch fails
getEnvironmentVariable
protected String getEnvironmentVariable(String name)