public class SpringApplicationTemplate
extends java.lang.Object
SpringApplicationTemplate
is meant to safely run SpringApplication
from a SpringApplicationBuilder
with a callback action SpringApplicationCallback
to do operations against an ApplicationContext
and then optionally return an value
back to a caller.Constructor and Description |
---|
SpringApplicationTemplate(org.springframework.boot.builder.SpringApplicationBuilder builder)
Instantiates a new spring application template.
|
Modifier and Type | Method and Description |
---|---|
<T> T |
execute(SpringApplicationCallback<T> action,
java.lang.String... args)
Execute spring application from a builder.
|
public SpringApplicationTemplate(org.springframework.boot.builder.SpringApplicationBuilder builder)
builder
- the spring application builderpublic <T> T execute(SpringApplicationCallback<T> action, java.lang.String... args) throws SpringApplicationException
T
- return typeaction
- the action callbackargs
- the boot application argsSpringApplicationException