Class ReactiveMongoClientFactoryBean
java.lang.Object
org.springframework.beans.factory.config.AbstractFactoryBean<com.mongodb.reactivestreams.client.MongoClient>
org.springframework.data.mongodb.core.ReactiveMongoClientFactoryBean
- 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.reactivestreams.client.MongoClient>,org.springframework.beans.factory.InitializingBean,org.springframework.dao.support.PersistenceExceptionTranslator
public class ReactiveMongoClientFactoryBean
extends org.springframework.beans.factory.config.AbstractFactoryBean<com.mongodb.reactivestreams.client.MongoClient>
implements org.springframework.dao.support.PersistenceExceptionTranslator
Convenient factory for configuring a reactive streams
MongoClient.- Since:
- 2.0
- Author:
- Mark Paluch, Christoph Strobl
-
Field Summary
Fields inherited from class org.springframework.beans.factory.config.AbstractFactoryBean
loggerFields inherited from interface org.springframework.beans.factory.FactoryBean
OBJECT_TYPE_ATTRIBUTE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected com.mongodb.reactivestreams.client.MongoClientprotected voiddestroyInstance(com.mongodb.reactivestreams.client.MongoClient instance) Class<?>voidsetConnectionString(String connectionString) Configures the connection string.voidsetExceptionTranslator(org.springframework.dao.support.PersistenceExceptionTranslator exceptionTranslator) Configures thePersistenceExceptionTranslatorto use.voidConfigures the host to connect to.voidsetMongoClientSettings(com.mongodb.MongoClientSettings mongoClientSettings) Configures the mongo client settings.voidsetPort(int port) Configures the port to connect to.org.springframework.dao.DataAccessExceptionMethods inherited from class org.springframework.beans.factory.config.AbstractFactoryBean
afterPropertiesSet, destroy, getBeanFactory, getBeanTypeConverter, getEarlySingletonInterfaces, getObject, isSingleton, setBeanClassLoader, setBeanFactory, setSingleton
-
Constructor Details
-
ReactiveMongoClientFactoryBean
public ReactiveMongoClientFactoryBean()
-
-
Method Details
-
setHost
Configures the host to connect to.- Parameters:
host-
-
setPort
public void setPort(int port) Configures the port to connect to.- Parameters:
port-
-
setConnectionString
Configures the connection string.- Parameters:
connectionString-
-
setMongoClientSettings
public void setMongoClientSettings(@Nullable com.mongodb.MongoClientSettings mongoClientSettings) Configures the mongo client settings.- Parameters:
mongoClientSettings-
-
setExceptionTranslator
public void setExceptionTranslator(@Nullable org.springframework.dao.support.PersistenceExceptionTranslator exceptionTranslator) Configures thePersistenceExceptionTranslatorto use.- Parameters:
exceptionTranslator-
-
getObjectType
- Specified by:
getObjectTypein interfaceorg.springframework.beans.factory.FactoryBean<com.mongodb.reactivestreams.client.MongoClient>- Specified by:
getObjectTypein classorg.springframework.beans.factory.config.AbstractFactoryBean<com.mongodb.reactivestreams.client.MongoClient>
-
createInstance
- Specified by:
createInstancein classorg.springframework.beans.factory.config.AbstractFactoryBean<com.mongodb.reactivestreams.client.MongoClient>- Throws:
Exception
-
destroyInstance
protected void destroyInstance(@Nullable com.mongodb.reactivestreams.client.MongoClient instance) throws Exception - Overrides:
destroyInstancein classorg.springframework.beans.factory.config.AbstractFactoryBean<com.mongodb.reactivestreams.client.MongoClient>- Throws:
Exception
-
translateExceptionIfPossible
public org.springframework.dao.DataAccessException translateExceptionIfPossible(RuntimeException ex) - Specified by:
translateExceptionIfPossiblein interfaceorg.springframework.dao.support.PersistenceExceptionTranslator
-