Example usage for org.springframework.boot.web.servlet.context AnnotationConfigServletWebServerApplicationContext AnnotationConfigServletWebServerApplicationContext

List of usage examples for org.springframework.boot.web.servlet.context AnnotationConfigServletWebServerApplicationContext AnnotationConfigServletWebServerApplicationContext

Introduction

In this page you can find the example usage for org.springframework.boot.web.servlet.context AnnotationConfigServletWebServerApplicationContext AnnotationConfigServletWebServerApplicationContext.

Prototype

public AnnotationConfigServletWebServerApplicationContext() 

Source Link

Document

Create a new AnnotationConfigServletWebServerApplicationContext that needs to be populated through #register calls and then manually #refresh refreshed .

Usage

From source file:org.springframework.boot.actuate.autoconfigure.metrics.PublicMetricsAutoConfigurationTests.java

private void loadWeb(Class<?>... config) {
    AnnotationConfigServletWebServerApplicationContext context = new AnnotationConfigServletWebServerApplicationContext();
    if (config.length > 0) {
        context.register(config);//ww w .ja  va  2 s . com
    }
    context.register(DataSourcePoolMetadataProvidersConfiguration.class, CacheStatisticsAutoConfiguration.class,
            PublicMetricsAutoConfiguration.class, MockServletWebServerFactory.class);
    context.refresh();
    this.context = context;
}