类 SpringApplicationLauncher
- java.lang.Object
- org.springframework.boot.cli.app.SpringApplicationLauncher
public class SpringApplicationLauncher extends Object
A launcher forSpringApplicationor aSpringApplicationsubclass. The class that is used can be configured using the System propertyspring.application.class.nameor theSPRING_APPLICATION_CLASS_NAMEenvironment 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 givenclassLoaderto load the configuredSpringApplicationclass.
构造器详细资料
SpringApplicationLauncher
public SpringApplicationLauncher(ClassLoader classLoader)
Creates a new launcher that will use the givenclassLoaderto load the configuredSpringApplicationclass.- 参数:
classLoader- theClassLoaderto 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)