Example usage for org.springframework.web.context.support XmlWebApplicationContext close

List of usage examples for org.springframework.web.context.support XmlWebApplicationContext close

Introduction

In this page you can find the example usage for org.springframework.web.context.support XmlWebApplicationContext close.

Prototype

@Override
public void close() 

Source Link

Document

Close this application context, destroying all beans in its bean factory.

Usage

From source file:org.openmrs.web.DispatcherServlet.java

/**
 * Stops and closes the application context created by this dispatcher servlet.
 *//*from  www .j  a va2  s. c o  m*/
public void stopAndCloseApplicationContext() {
    try {
        XmlWebApplicationContext ctx = (XmlWebApplicationContext) getWebApplicationContext();
        ctx.stop();
        ctx.close();
    } catch (Exception e) {
        log.error("Exception while stopping and closing dispatcherServlet context: ", e);
    }
}

From source file:org.openmrs.web.StaticDispatcherServlet.java

public void stopAndCloseApplicationContext() {
    try {/*  w  w  w. ja  v a2  s . c o m*/
        XmlWebApplicationContext ctx = (XmlWebApplicationContext) getWebApplicationContext();
        ctx.stop();
        ctx.close();
    } catch (Exception e) {
        log.error("Exception while stopping and closing static content dispatcher servlet context: ", e);
    }
}