@Singleton public class MongoClients extends Object
MongoClient and ReactiveMongoClient.
It isn't a CDI producer in the literal sense, but it is marked as a bean
and its createMongoClient and createReactiveMongoClient methods are called at runtime in order to produce
the actual client objects.| Constructor and Description |
|---|
MongoClients(MongodbConfig mongodbConfig,
MongoClientSupport mongoClientSupport) |
| Modifier and Type | Method and Description |
|---|---|
com.mongodb.client.MongoClient |
createMongoClient(String clientName) |
ReactiveMongoClient |
createReactiveMongoClient(String clientName) |
MongoClientConfig |
getMatchingMongoClientConfig(String clientName) |
void |
stop() |
public MongoClients(MongodbConfig mongodbConfig, MongoClientSupport mongoClientSupport)
public com.mongodb.client.MongoClient createMongoClient(String clientName) throws com.mongodb.MongoException
com.mongodb.MongoExceptionpublic ReactiveMongoClient createReactiveMongoClient(String clientName) throws com.mongodb.MongoException
com.mongodb.MongoExceptionpublic MongoClientConfig getMatchingMongoClientConfig(String clientName)
@PreDestroy public void stop()
Copyright © 2021 JBoss by Red Hat. All rights reserved.