public class MongoFactoryBean extends Object implements FactoryBean<Mongo>, InitializingBean, DisposableBean, PersistenceExceptionTranslator
Constructor and Description |
---|
MongoFactoryBean() |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
void |
destroy() |
Mongo |
getObject() |
Class<? extends Mongo> |
getObjectType() |
boolean |
isSingleton() |
void |
setExceptionTranslator(PersistenceExceptionTranslator exceptionTranslator) |
void |
setHost(String host) |
void |
setMongoOptions(MongoOptions mongoOptions) |
void |
setPort(int port) |
void |
setReplicaPair(ServerAddress[] replicaPair) |
void |
setReplicaSetSeeds(ServerAddress[] replicaSetSeeds) |
void |
setWriteConcern(WriteConcern writeConcern)
Sets the
WriteConcern to be configured for the Mongo instance to be created. |
DataAccessException |
translateExceptionIfPossible(RuntimeException ex) |
public void setMongoOptions(MongoOptions mongoOptions)
public void setReplicaSetSeeds(ServerAddress[] replicaSetSeeds)
public void setReplicaPair(ServerAddress[] replicaPair)
public void setHost(String host)
public void setPort(int port)
public void setWriteConcern(WriteConcern writeConcern)
WriteConcern
to be configured for the Mongo
instance to be created.writeConcern
- public void setExceptionTranslator(PersistenceExceptionTranslator exceptionTranslator)
public Mongo getObject() throws Exception
getObject
in interface FactoryBean<Mongo>
Exception
public Class<? extends Mongo> getObjectType()
getObjectType
in interface FactoryBean<Mongo>
public boolean isSingleton()
isSingleton
in interface FactoryBean<Mongo>
public DataAccessException translateExceptionIfPossible(RuntimeException ex)
translateExceptionIfPossible
in interface PersistenceExceptionTranslator
public void afterPropertiesSet() throws Exception
afterPropertiesSet
in interface InitializingBean
Exception
public void destroy() throws Exception
destroy
in interface DisposableBean
Exception
Copyright © 2012. All Rights Reserved.