Example usage for org.springframework.context.support GenericXmlApplicationContext destroy

List of usage examples for org.springframework.context.support GenericXmlApplicationContext destroy

Introduction

In this page you can find the example usage for org.springframework.context.support GenericXmlApplicationContext destroy.

Prototype

@Deprecated
public void destroy() 

Source Link

Document

Callback for destruction of this instance, originally attached to a DisposableBean implementation (not anymore in 5.0).

Usage

From source file:com.home.ln_spring.ch5.lifecycle.DestructiveBean.java

public static void main(String[] args) {
    GenericXmlApplicationContext ctx = new GenericXmlApplicationContext();
    ctx.load("classpath:lifecycle/disposeMethod.xml");
    ctx.refresh();//from www  .j  av a  2 s  . co m

    DestructiveBean bean = (DestructiveBean) ctx.getBean("destructiveBean");
    System.out.println("Calling destroy()");
    ctx.destroy();
    System.out.println("Called destroy()");
}