org.springframework.data.document.mongodb
Class MongoFactoryBean
java.lang.Object
org.springframework.data.document.mongodb.MongoFactoryBean
- All Implemented Interfaces:
- FactoryBean<Mongo>, InitializingBean, PersistenceExceptionTranslator
public class MongoFactoryBean
- extends Object
- implements FactoryBean<Mongo>, InitializingBean, PersistenceExceptionTranslator
Convenient factory for configuring MongoDB.
- Since:
- 1.0
- Author:
- Thomas Risberg, Graeme Rocher
Field Summary |
protected org.apache.commons.logging.Log |
logger
Logger, available to subclasses. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
logger
protected final org.apache.commons.logging.Log logger
- Logger, available to subclasses.
MongoFactoryBean
public MongoFactoryBean()
setMongoOptions
public void setMongoOptions(MongoOptions mongoOptions)
setReplicaSetSeeds
public void setReplicaSetSeeds(List<ServerAddress> replicaSetSeeds)
setReplicaPair
public void setReplicaPair(List<ServerAddress> replicaPair)
setHost
public void setHost(String host)
setPort
public void setPort(int port)
getExceptionTranslator
public PersistenceExceptionTranslator getExceptionTranslator()
setExceptionTranslator
public void setExceptionTranslator(PersistenceExceptionTranslator exceptionTranslator)
getObject
public Mongo getObject()
throws Exception
- Specified by:
getObject
in interface FactoryBean<Mongo>
- Throws:
Exception
getObjectType
public Class<? extends Mongo> getObjectType()
- Specified by:
getObjectType
in interface FactoryBean<Mongo>
isSingleton
public boolean isSingleton()
- Specified by:
isSingleton
in interface FactoryBean<Mongo>
afterPropertiesSet
public void afterPropertiesSet()
throws Exception
- Specified by:
afterPropertiesSet
in interface InitializingBean
- Throws:
Exception
translateExceptionIfPossible
public DataAccessException translateExceptionIfPossible(RuntimeException ex)
- Specified by:
translateExceptionIfPossible
in interface PersistenceExceptionTranslator
Copyright © 2011. All Rights Reserved.