public static class

Mongo.Holder

extends Object
java.lang.Object
   ↳ com.mongodb.Mongo.Holder

Class Overview

Mongo.Holder can be used as a static place to hold several instances of Mongo. Security is not enforced at this level, and needs to be done on the application side.

Summary

Public Constructors
Mongo.Holder()
Public Methods
Mongo connect(MongoURI uri)
Attempts to find an existing Mongo instance matching that URI in the holder, and returns it if exists.
static Mongo.Holder singleton()
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public Mongo.Holder ()

Public Methods

public Mongo connect (MongoURI uri)

Attempts to find an existing Mongo instance matching that URI in the holder, and returns it if exists. Otherwise creates a new Mongo instance based on this URI and adds it to the holder.@return

Parameters
uri the Mongo URI
Throws
MongoException
UnknownHostException
MongoException

public static Mongo.Holder singleton ()