Package org.springframework.boot.cli.app
Class SpringApplicationLauncher
java.lang.Object
org.springframework.boot.cli.app.SpringApplicationLauncher
A launcher for
SpringApplication or a SpringApplication subclass. The
class that is used can be configured using the System property
spring.application.class.name or the SPRING_APPLICATION_CLASS_NAME
environment variable. Uses reflection to allow the launching code to exist in a
separate ClassLoader from the application code.- Since:
- 1.2.0
- Author:
- Andy Wilkinson
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionSpringApplicationLauncher(ClassLoader classLoader) Creates a new launcher that will use the givenclassLoaderto load the configuredSpringApplicationclass. -
Method Summary
-
Constructor Details
-
SpringApplicationLauncher
Creates a new launcher that will use the givenclassLoaderto load the configuredSpringApplicationclass.- Parameters:
classLoader- theClassLoaderto use
-
-
Method Details
-
launch
Launches the application created using the givensources. The application is launched with the givenargs.- Parameters:
sources- the sources for the applicationargs- the args for the application- Returns:
- the application's
ApplicationContext - Throws:
Exception- if the launch fails
-
getEnvironmentVariable
-