public class SpringApplicationLauncher extends Object
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.System.getProperty(String)
,
System.getenv(String)
Constructor and Description |
---|
SpringApplicationLauncher(ClassLoader classLoader)
Creates a new launcher that will use the given
classLoader to load the
configured SpringApplication class. |
Modifier and Type | Method and Description |
---|---|
protected String |
getEnvironmentVariable(String name) |
Object |
launch(Class<?>[] sources,
String[] args)
Launches the application created using the given
sources . |
public SpringApplicationLauncher(ClassLoader classLoader)
classLoader
to load the
configured SpringApplication
class.classLoader
- the ClassLoader
to usepublic Object launch(Class<?>[] sources, String[] args) throws Exception
sources
. The application
is launched with the given args
.sources
- The sources for the applicationargs
- The args for the applicationApplicationContext
Exception
- if the launch failsCopyright © 2017 Pivotal Software, Inc.. All rights reserved.