use of org.springframework.web.context.support.AnnotationConfigWebApplicationContext in project spring-boot-admin by codecentric.
the class SpringBootAdminClientAutoConfigurationTest method load.
private void load(String... environment) {
AnnotationConfigWebApplicationContext applicationContext = new AnnotationConfigWebApplicationContext();
applicationContext.register(ServerPropertiesAutoConfiguration.class);
applicationContext.register(RestTemplateConfiguration.class);
applicationContext.register(ManagementServerPropertiesAutoConfiguration.class);
applicationContext.register(EndpointAutoConfiguration.class);
applicationContext.register(EndpointWebMvcManagementContextConfiguration.class);
applicationContext.register(SpringBootAdminClientAutoConfiguration.class);
EnvironmentTestUtils.addEnvironment(applicationContext, environment);
applicationContext.refresh();
this.context = applicationContext;
}
use of org.springframework.web.context.support.AnnotationConfigWebApplicationContext in project spring-boot-admin by codecentric.
the class NotifierConfigurationTest method load.
private void load(Class<?> config, String... environment) {
context = new AnnotationConfigWebApplicationContext();
if (config != null) {
context.register(config);
}
context.register(MailSenderAutoConfiguration.class);
context.register(NotifierConfiguration.class);
EnvironmentTestUtils.addEnvironment(context, environment);
context.refresh();
}
use of org.springframework.web.context.support.AnnotationConfigWebApplicationContext in project spring-boot-admin by codecentric.
the class DiscoveryClientConfigurationTest method load.
private void load(Class<?>... configs) {
AnnotationConfigWebApplicationContext applicationContext = new AnnotationConfigWebApplicationContext();
for (Class<?> config : configs) {
applicationContext.register(config);
}
applicationContext.register(PropertyPlaceholderAutoConfiguration.class);
applicationContext.register(RestTemplateConfiguration.class);
applicationContext.register(ServerPropertiesAutoConfiguration.class);
applicationContext.register(AdminServerCoreConfiguration.class);
applicationContext.register(AdminServerWebConfiguration.class);
applicationContext.register(DiscoveryClientConfiguration.class);
applicationContext.refresh();
this.context = applicationContext;
}
use of org.springframework.web.context.support.AnnotationConfigWebApplicationContext in project spring-boot by spring-projects.
the class EmbeddedJarStarter method main.
public static void main(String[] args) throws Exception {
Server server = new Server(8080);
ServletContextHandler context = new ServletContextHandler(ServletContextHandler.SESSIONS);
context.setContextPath("/");
server.setHandler(context);
AnnotationConfigWebApplicationContext webApplicationContext = new AnnotationConfigWebApplicationContext();
webApplicationContext.register(SpringConfiguration.class);
DispatcherServlet dispatcherServlet = new DispatcherServlet(webApplicationContext);
context.addServlet(new ServletHolder(dispatcherServlet), "/*");
server.start();
server.join();
}
use of org.springframework.web.context.support.AnnotationConfigWebApplicationContext in project Activiti by Activiti.
the class WebConfigurer method initSpring.
/**
* Initializes Spring and Spring MVC.
*/
private ServletRegistration.Dynamic initSpring(ServletContext servletContext, AnnotationConfigWebApplicationContext rootContext) {
log.debug("Configuring Spring Web application context");
AnnotationConfigWebApplicationContext dispatcherServletConfiguration = new AnnotationConfigWebApplicationContext();
dispatcherServletConfiguration.setParent(rootContext);
dispatcherServletConfiguration.register(DispatcherServletConfiguration.class);
log.debug("Registering Spring MVC Servlet");
ServletRegistration.Dynamic dispatcherServlet = servletContext.addServlet("dispatcher", new DispatcherServlet(dispatcherServletConfiguration));
dispatcherServlet.addMapping("/service/*");
dispatcherServlet.setLoadOnStartup(1);
dispatcherServlet.setAsyncSupported(true);
return dispatcherServlet;
}
Aggregations