Spring Data Document

org.springframework.data.document.mongodb
Class MongoFactoryBean

java.lang.Object
  extended by 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.
 
Constructor Summary
MongoFactoryBean()
           
 
Method Summary
 void afterPropertiesSet()
           
 PersistenceExceptionTranslator getExceptionTranslator()
           
 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(List<ServerAddress> replicaPair)
           
 void setReplicaSetSeeds(List<ServerAddress> replicaSetSeeds)
           
 DataAccessException translateExceptionIfPossible(RuntimeException ex)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected final org.apache.commons.logging.Log logger
Logger, available to subclasses.

Constructor Detail

MongoFactoryBean

public MongoFactoryBean()
Method Detail

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

Spring Data Document

Copyright © 2011. All Rights Reserved.