Class MongoClients


  • @Singleton
    public class MongoClients
    extends Object
    This class is sort of a producer for 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 Detail

      • MongoClients

        public MongoClients​(MongodbConfig mongodbConfig,
                            MongoClientSupport mongoClientSupport,
                            javax.enterprise.inject.Instance<org.bson.codecs.configuration.CodecProvider> codecProviders,
                            javax.enterprise.inject.Instance<org.bson.codecs.pojo.PropertyCodecProvider> propertyCodecProviders,
                            javax.enterprise.inject.Instance<com.mongodb.event.CommandListener> commandListeners)
    • Method Detail

      • createMongoClient

        public com.mongodb.client.MongoClient createMongoClient​(String clientName)
                                                         throws com.mongodb.MongoException
        Throws:
        com.mongodb.MongoException
      • createReactiveMongoClient

        public ReactiveMongoClient createReactiveMongoClient​(String clientName)
                                                      throws com.mongodb.MongoException
        Throws:
        com.mongodb.MongoException
      • stop

        @PreDestroy
        public void stop()