public static synchronized MongoClient create ( final MongoClientSettings mongoClientSettings ) { if ( mongoEmbeddedLibrary == null ) { throw new MongoClientEmbeddedException ( "The mongo embedded library must be initialized first." ) ; } try { Cluster cluster = new EmbeddedCluster ( mongoEmbeddedLibrary , mongoClientSettings ) ; return new MongoClientImpl ( cluster , mongoClientSettings . getWrappedMongoClientSettings ( ) , null ) ; } catch ( Exception e ) { throw new MongoClientEmbeddedException ( format ( "Could not create a new embedded cluster.%n" + "Please ensure any existing MongoClients are fully closed before trying to create a new one.%n" + "Server error message: %s" , e . getMessage ( ) ) , e ) ; } }
Creates a new client .