Example usage for com.mongodb Mongo close

List of usage examples for com.mongodb Mongo close

Introduction

In this page you can find the example usage for com.mongodb Mongo close.

Prototype

public void close() 

Source Link

Document

Closes all resources associated with this instance, in particular any open network connections.

Usage

From source file:se.inera.axel.riv.impl.MongoDBTestContextConfig.java

License:Open Source License

@Override
public void destroy() throws Exception {
    Mongo mongo = mongo();

    if (mongo != null)
        mongo.close();

    MongodProcess mongodProcess = mongodProcess();

    if (mongodProcess != null)
        mongodProcess.stop();/*ww w . j  ava 2s  .  c o  m*/
}