List of usage examples for org.springframework.context.support GenericXmlApplicationContext destroy
@Deprecated public void destroy()
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()"); }