public class MongoDBImpl extends Object implements MongoDB, ThreadCleanupListener
MongoDB
Constructor and Description |
---|
MongoDBImpl(org.slf4j.Logger logger,
MongoDBSource mongoDBSource,
String defaultDbName,
boolean consistentRequest,
boolean secureMode,
String dbUsername,
String dbPassword) |
Modifier and Type | Method and Description |
---|---|
com.mongodb.DB |
getDefaultMongoDb()
Obtain a shared instance of the MongoDB database connection object connected
to the default database
|
com.mongodb.DB |
getMongoDb(String dbname)
Obtain a shared instance of the MongoDB database connection object for the
specific database
|
void |
threadDidCleanup()
Invoked by
PerthreadManager service when a thread performs and
end-of-request cleanup. |
public MongoDBImpl(org.slf4j.Logger logger, MongoDBSource mongoDBSource, String defaultDbName, boolean consistentRequest, boolean secureMode, String dbUsername, String dbPassword)
public com.mongodb.DB getDefaultMongoDb()
MongoDB
getDefaultMongoDb
in interface MongoDB
DB
connection objectpublic com.mongodb.DB getMongoDb(String dbname)
MongoDB
getMongoDb
in interface MongoDB
dbname
- the database name to connect toDB
connection objectpublic void threadDidCleanup()
ThreadCleanupListener
PerthreadManager
service when a thread performs and
end-of-request cleanup.threadDidCleanup
in interface ThreadCleanupListener
${project.version} - Copyright © 2003-2015 The Apache Software Foundation.