public class MongoFactoryBean extends Object implements org.springframework.beans.factory.FactoryBean<com.mongodb.Mongo>, org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.DisposableBean, org.springframework.dao.support.PersistenceExceptionTranslator
Constructor and Description |
---|
MongoFactoryBean() |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
void |
destroy() |
com.mongodb.Mongo |
getObject() |
Class<? extends com.mongodb.Mongo> |
getObjectType() |
boolean |
isSingleton() |
void |
setExceptionTranslator(org.springframework.dao.support.PersistenceExceptionTranslator exceptionTranslator) |
void |
setHost(String host) |
void |
setMongoOptions(com.mongodb.MongoOptions mongoOptions) |
void |
setPort(int port) |
void |
setReplicaPair(com.mongodb.ServerAddress[] replicaPair)
Deprecated.
use
setReplicaSetSeeds(ServerAddress[]) instead |
void |
setReplicaSetSeeds(com.mongodb.ServerAddress[] replicaSetSeeds) |
void |
setWriteConcern(com.mongodb.WriteConcern writeConcern)
Sets the
WriteConcern to be configured for the Mongo instance to be created. |
org.springframework.dao.DataAccessException |
translateExceptionIfPossible(RuntimeException ex) |
public void setMongoOptions(com.mongodb.MongoOptions mongoOptions)
public void setReplicaSetSeeds(com.mongodb.ServerAddress[] replicaSetSeeds)
@Deprecated public void setReplicaPair(com.mongodb.ServerAddress[] replicaPair)
setReplicaSetSeeds(ServerAddress[])
insteadreplicaPair
- public void setHost(String host)
public void setPort(int port)
public void setWriteConcern(com.mongodb.WriteConcern writeConcern)
WriteConcern
to be configured for the Mongo
instance to be created.writeConcern
- public void setExceptionTranslator(org.springframework.dao.support.PersistenceExceptionTranslator exceptionTranslator)
public com.mongodb.Mongo getObject() throws Exception
getObject
in interface org.springframework.beans.factory.FactoryBean<com.mongodb.Mongo>
Exception
public Class<? extends com.mongodb.Mongo> getObjectType()
getObjectType
in interface org.springframework.beans.factory.FactoryBean<com.mongodb.Mongo>
public boolean isSingleton()
isSingleton
in interface org.springframework.beans.factory.FactoryBean<com.mongodb.Mongo>
public org.springframework.dao.DataAccessException translateExceptionIfPossible(RuntimeException ex)
translateExceptionIfPossible
in interface org.springframework.dao.support.PersistenceExceptionTranslator
public void afterPropertiesSet() throws Exception
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
Exception
Copyright © 2015. All rights reserved.