Class MongoDBImpl
java.lang.Object
org.apache.tapestry5.internal.mongodb.MongoDBImpl
- All Implemented Interfaces:
EventListener
,ThreadCleanupListener
,MongoDB
Default implementation for
MongoDB
-
Constructor Summary
ConstructorsConstructorDescriptionMongoDBImpl
(org.slf4j.Logger logger, MongoDBSource mongoDBSource, String defaultDbName, boolean consistentRequest, boolean secureMode, String dbUsername, String dbPassword) -
Method Summary
Modifier and TypeMethodDescriptioncom.mongodb.DB
Obtain a shared instance of the MongoDB database connection object connected to the default databasecom.mongodb.DB
getMongoDb
(String dbname) Obtain a shared instance of the MongoDB database connection object for the specific databasevoid
Invoked byPerthreadManager
service when a thread performs and end-of-request cleanup.
-
Constructor Details
-
MongoDBImpl
public MongoDBImpl(org.slf4j.Logger logger, MongoDBSource mongoDBSource, String defaultDbName, boolean consistentRequest, boolean secureMode, String dbUsername, String dbPassword)
-
-
Method Details
-
getDefaultMongoDb
Description copied from interface:MongoDB
Obtain a shared instance of the MongoDB database connection object connected to the default database- Specified by:
getDefaultMongoDb
in interfaceMongoDB
- Returns:
- the
DB
connection object
-
getMongoDb
Description copied from interface:MongoDB
Obtain a shared instance of the MongoDB database connection object for the specific database- Specified by:
getMongoDb
in interfaceMongoDB
- Parameters:
dbname
- the database name to connect to- Returns:
- the
DB
connection object
-
threadDidCleanup
Description copied from interface:ThreadCleanupListener
Invoked byPerthreadManager
service when a thread performs and end-of-request cleanup.- Specified by:
threadDidCleanup
in interfaceThreadCleanupListener
-