Class DefaultMongoClientFactory
java.lang.Object
io.micronaut.configuration.mongo.sync.DefaultMongoClientFactory
@Requires(classes=com.mongodb.client.MongoClient.class) @Requires(beans=DefaultMongoConfiguration.class)
@Factory
public class DefaultMongoClientFactory
extends Object
Builds the primary MongoClient.
- Since:
- 1.0
- Author:
- graemerocher
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected com.mongodb.client.MongoClient
mongoClient
(com.mongodb.MongoClientSettings settings) Factory method to return a client.
-
Constructor Details
-
DefaultMongoClientFactory
public DefaultMongoClientFactory()
-
-
Method Details
-
mongoClient
@Bean(preDestroy="close") @Primary @Singleton protected com.mongodb.client.MongoClient mongoClient(com.mongodb.MongoClientSettings settings) Factory method to return a client.- Parameters:
settings
- configuration pulled in- Returns:
- mongoClient
-