public class EmbeddedMongoFactoryBean extends Object implements org.springframework.beans.factory.FactoryBean<com.mongodb.Mongo>, org.springframework.beans.factory.DisposableBean
Mongo.
Unlike EmbedMongo default settings, this factory uses Slf4j for all logging by default so you can use any logging implementation you want. To tweak logging levels use this classes as logger names:
This is not truly embedded Mongo as there's no Java implementation of the
MongoDB. EmbedMongo actually downloads original MongoDB binary for your
platform and executes it. EmbedMongo process is stopped automatically when
you close connection with Mongo.
| Constructor and Description |
|---|
EmbeddedMongoFactoryBean() |
| Modifier and Type | Method and Description |
|---|---|
void |
destroy() |
String |
getBindIp() |
com.mongodb.Mongo |
getObject() |
Class<com.mongodb.Mongo> |
getObjectType() |
int |
getPort() |
String |
getVersion() |
boolean |
isSingleton() |
void |
setBindIp(String bindIp)
An IP address for the MongoDB instance to be bound to during its execution.
|
void |
setPort(int port)
The port MongoDB should run on.
|
void |
setVersion(String version)
The version of MongoDB to run e.g.
|
public com.mongodb.Mongo getObject()
throws IOException
getObject in interface org.springframework.beans.factory.FactoryBean<com.mongodb.Mongo>IOExceptionpublic Class<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 void destroy()
destroy in interface org.springframework.beans.factory.DisposableBeanpublic void setVersion(String version)
PRODUCTION
is used by default.version - The MongoDB version.public String getVersion()
public void setPort(int port)
port - The port to run on.public int getPort()
public void setBindIp(String bindIp)
bindIp - The IPv4 or IPv6 address to bound.public String getBindIp()
Copyright © 2013. All rights reserved.