Search in sources :

Example 1 with RestartScopeInitializer

use of org.springframework.boot.devtools.restart.RestartScopeInitializer in project spring-boot by spring-projects.

the class RemoteClientConfigurationTests method configure.

private void configure(String remoteUrl, boolean setSecret, String... pairs) {
    this.context = new AnnotationConfigServletWebServerApplicationContext();
    new RestartScopeInitializer().initialize(this.context);
    this.context.register(Config.class, RemoteClientConfiguration.class);
    String remoteUrlProperty = "remoteUrl:" + remoteUrl + ":" + RemoteClientConfigurationTests.remotePort;
    EnvironmentTestUtils.addEnvironment(this.context, remoteUrlProperty);
    EnvironmentTestUtils.addEnvironment(this.context, pairs);
    if (setSecret) {
        EnvironmentTestUtils.addEnvironment(this.context, "spring.devtools.remote.secret:secret");
    }
    this.context.refresh();
}
Also used : RestartScopeInitializer(org.springframework.boot.devtools.restart.RestartScopeInitializer) AnnotationConfigServletWebServerApplicationContext(org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext)

Example 2 with RestartScopeInitializer

use of org.springframework.boot.devtools.restart.RestartScopeInitializer in project spring-boot by spring-projects.

the class RemoteSpringApplication method getInitializers.

private Collection<ApplicationContextInitializer<?>> getInitializers() {
    List<ApplicationContextInitializer<?>> initializers = new ArrayList<>();
    initializers.add(new RestartScopeInitializer());
    return initializers;
}
Also used : RestartScopeInitializer(org.springframework.boot.devtools.restart.RestartScopeInitializer) ArrayList(java.util.ArrayList) ApplicationContextInitializer(org.springframework.context.ApplicationContextInitializer)

Aggregations

RestartScopeInitializer (org.springframework.boot.devtools.restart.RestartScopeInitializer)2 ArrayList (java.util.ArrayList)1 AnnotationConfigServletWebServerApplicationContext (org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext)1 ApplicationContextInitializer (org.springframework.context.ApplicationContextInitializer)1