Example usage for org.springframework.context.annotation AnnotationConfigApplicationContext destroy

List of usage examples for org.springframework.context.annotation AnnotationConfigApplicationContext destroy

Introduction

In this page you can find the example usage for org.springframework.context.annotation AnnotationConfigApplicationContext 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.graphaware.runtime.spring.SpringIntegrationTest.java

@Test
public void changeFeedShouldWorkWithSpring() {
    AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(Config.class);

    assertNotNull(context.getBean(GraphDatabaseService.class));
    assertNotNull(context.getBean(UuidReader.class));

    context.destroy();
}

From source file:net.ggtools.maven.DDLGeneratorMojo.java

public void execute() throws MojoExecutionException {
    AnnotationConfigApplicationContext applicationContext = null;

    try {/*ww w.j a v a  2  s .com*/
        applicationContext = createApplicationContext();
        final DDLGenerator generator = applicationContext.getBean(DDLGenerator.class);
        getLog().info("Creating schema to " + ddlFile);
        generator.createSchema();
    } finally {
        if (applicationContext != null) {
            applicationContext.destroy();
        }
    }
}