Package org.craftercms.commons.mongo
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
-
Field Summary
Fields inherited from class org.springframework.beans.factory.config.AbstractFactoryBean
logger
Fields inherited from interface org.springframework.beans.factory.FactoryBean
OBJECT_TYPE_ATTRIBUTE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected com.mongodb.MongoClientOptions
Class<?>
void
setConnectionsPerHost
(int connectionsPerHost) void
setConnectTimeout
(int connectTimeout) void
setCursorFinalizerEnabled
(boolean cursorFinalizerEnabled) void
setMaxWaitTime
(int maxWaitTime) void
setReadPreference
(int readPreference) void
setWriteConcern
(String writeConcern) Methods inherited from class org.springframework.beans.factory.config.AbstractFactoryBean
afterPropertiesSet, destroy, destroyInstance, getBeanFactory, getBeanTypeConverter, getEarlySingletonInterfaces, getObject, isSingleton, setBeanClassLoader, setBeanFactory, setSingleton
-
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
-
getObjectType
- Specified by:
getObjectType
in interfaceorg.springframework.beans.factory.FactoryBean<com.mongodb.MongoClientOptions>
- Specified by:
getObjectType
in classorg.springframework.beans.factory.config.AbstractFactoryBean<com.mongodb.MongoClientOptions>
-
createInstance
- Specified by:
createInstance
in classorg.springframework.beans.factory.config.AbstractFactoryBean<com.mongodb.MongoClientOptions>
- Throws:
Exception
-