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:
Aware
,BeanClassLoaderAware
,BeanFactoryAware
,DisposableBean
,FactoryBean<com.mongodb.reactivestreams.client.MongoClient>
,InitializingBean
,PersistenceExceptionTranslator
public class ReactiveMongoClientFactoryBean
extends AbstractFactoryBean<com.mongodb.reactivestreams.client.MongoClient>
implements 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
logger
Fields inherited from interface org.springframework.beans.factory.FactoryBean
OBJECT_TYPE_ATTRIBUTE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected com.mongodb.reactivestreams.client.MongoClient
protected void
destroyInstance
(com.mongodb.reactivestreams.client.MongoClient instance) Class<?>
void
setConnectionString
(String connectionString) Configures the connection string.void
setExceptionTranslator
(PersistenceExceptionTranslator exceptionTranslator) Configures thePersistenceExceptionTranslator
to use.void
Configures the host to connect to.void
setMongoClientSettings
(com.mongodb.MongoClientSettings mongoClientSettings) Configures the mongo client settings.void
setPort
(int port) Configures the port to connect to.Methods 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
Configures the mongo client settings.- Parameters:
mongoClientSettings
-
-
setExceptionTranslator
Configures thePersistenceExceptionTranslator
to use.- Parameters:
exceptionTranslator
-
-
translateExceptionIfPossible
- Specified by:
translateExceptionIfPossible
in interfacePersistenceExceptionTranslator
-
getObjectType
- Specified by:
getObjectType
in interfaceFactoryBean<com.mongodb.reactivestreams.client.MongoClient>
- Specified by:
getObjectType
in classAbstractFactoryBean<com.mongodb.reactivestreams.client.MongoClient>
-
createInstance
- Specified by:
createInstance
in classAbstractFactoryBean<com.mongodb.reactivestreams.client.MongoClient>
- Throws:
Exception
-
destroyInstance
protected void destroyInstance(@Nullable com.mongodb.reactivestreams.client.MongoClient instance) throws Exception - Overrides:
destroyInstance
in classAbstractFactoryBean<com.mongodb.reactivestreams.client.MongoClient>
- Throws:
Exception
-