Class MongoClientOptionsFactory

java.lang.Object
org.springframework.beans.factory.config.AbstractFactoryBean<com.mongodb.MongoClientOptions>
org.craftercms.commons.mongo.MongoClientOptionsFactory
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.FactoryBean<com.mongodb.MongoClientOptions>, org.springframework.beans.factory.InitializingBean

public class MongoClientOptionsFactory extends org.springframework.beans.factory.config.AbstractFactoryBean<com.mongodb.MongoClientOptions>
Spring helper for Create a MongoClient
  • Constructor Details

    • MongoClientOptionsFactory

      public MongoClientOptionsFactory()
  • Method Details

    • setReadPreference

      public void setReadPreference(int readPreference)
    • setConnectionsPerHost

      public void setConnectionsPerHost(int connectionsPerHost)
    • setCursorFinalizerEnabled

      public void setCursorFinalizerEnabled(boolean cursorFinalizerEnabled)
    • setConnectTimeout

      public void setConnectTimeout(int connectTimeout)
    • setMaxWaitTime

      public void setMaxWaitTime(int maxWaitTime)
    • setWriteConcern

      public void setWriteConcern(String writeConcern)
    • getObjectType

      public Class<?> getObjectType()
      Specified by:
      getObjectType in interface org.springframework.beans.factory.FactoryBean<com.mongodb.MongoClientOptions>
      Specified by:
      getObjectType in class org.springframework.beans.factory.config.AbstractFactoryBean<com.mongodb.MongoClientOptions>
    • createInstance

      protected com.mongodb.MongoClientOptions createInstance() throws Exception
      Specified by:
      createInstance in class org.springframework.beans.factory.config.AbstractFactoryBean<com.mongodb.MongoClientOptions>
      Throws:
      Exception