org.springframework.yarn.boot
Class SpringApplicationTemplate
java.lang.Object
org.springframework.yarn.boot.SpringApplicationTemplate
public class SpringApplicationTemplate
- extends 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.
- Author:
- Janne Valkealahti
|
Constructor Summary |
SpringApplicationTemplate(org.springframework.boot.builder.SpringApplicationBuilder builder)
Instantiates a new spring application template. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SpringApplicationTemplate
public SpringApplicationTemplate(org.springframework.boot.builder.SpringApplicationBuilder builder)
- Instantiates a new spring application template.
- Parameters:
builder - the spring application builder
execute
public <T> T execute(SpringApplicationCallback<T> action,
String... args)
throws SpringApplicationException
- Execute spring application from a builder. This method will automatically
close a context associated with a spring application.
- Parameters:
action - the action callbackargs - the boot application args
- Returns:
- the value from an execution
- Throws:
SpringApplicationException