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.
    • 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()