本文整理了Java中de.flapdoodle.embed.mongo.MongodProcess
类的一些代码示例,展示了MongodProcess
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。MongodProcess
类的具体详情如下:
包路径:de.flapdoodle.embed.mongo.MongodProcess
类名称:MongodProcess
暂无
代码示例来源:origin: spring-projects/spring-data-examples
public void stop() {
for (MongodProcess process : this.mongodProcessList) {
process.stop();
}
for (MongodProcess process : this.mongodConfigProcessList) {
process.stop();
}
this.mongosProcess.stop();
}
}
代码示例来源:origin: org.apache.rya/mongodb.rya
/**
* @return The process configuration.
*
*/
public IMongodConfig getMongoServerDetails() {
return mongodProcess.getConfig();
}
代码示例来源:origin: de.flapdoodle.embed/de.flapdoodle.embed.mongo
@Override
protected MongodProcess start(Distribution distribution, IMongodConfig config, IRuntimeConfig runtime)
throws IOException {
return new MongodProcess(distribution, config, runtime, this);
}
代码示例来源:origin: apache/incubator-rya
/**
* @return The process configuration.
*/
public IMongodConfig getMongoServerDetails() {
return mongodProcess.getConfig();
}
代码示例来源:origin: kaaproject/kaa
public static void tearDown() throws Exception {
mongod.stop();
mongoDBExec.stop();
}
代码示例来源:origin: apache/incubator-rya
/**
* @return A new Mongo client that is connected to the embedded MongoDB Server.
* @throws UnknownHostException The hostname used was unknown.
* @throws MongoException Couldn't create the client.
*/
public MongoClient newMongoClient() throws UnknownHostException, MongoException {
return new MongoClient(new ServerAddress(mongodProcess.getConfig().net().getServerAddress(), mongodProcess.getConfig().net().getPort()));
}
代码示例来源:origin: de.flapdoodle.embed/de.flapdoodle.embed.mongo
public void stop() {
for (MongodProcess process : this.mongodProcessList) {
process.stop();
}
for (MongodProcess process : this.mongodConfigProcessList) {
process.stop();
}
this.mongosProcess.stop();
}
}
代码示例来源:origin: org.apache.rya/mongodb.rya
/**
* @return A new Mongo client that is connected to the embedded MongoDB Server.
* @throws UnknownHostException The hostname used was unknown.
* @throws MongoException Couldn't create the client.
*/
public MongoClient newMongoClient() throws UnknownHostException, MongoException {
return new MongoClient(new ServerAddress(mongodProcess.getConfig().net().getServerAddress(), mongodProcess.getConfig().net().getPort()));
}
代码示例来源:origin: de.flapdoodle.embed/de.flapdoodle.embed.mongo
/**
* Cleans up the resources created by the utility.
*/
public void shutdown() {
mongodProcess.stop();
mongodExecutable.stop();
}
}
代码示例来源:origin: de.flapdoodle.embed/de.flapdoodle.embed.mongo
/**
* Creates a new Mongo connection.
*
*/
public MongoClient newMongo() throws UnknownHostException {
return new MongoClient(new ServerAddress(mongodProcess.getConfig().net().getServerAddress(),
mongodProcess.getConfig().net().getPort()));
}
代码示例来源:origin: com.github.mlk/assortmentofjunitrules
@Override
public void after() {
if (this.mongod != null) {
this.mongod.stop();
this.mongodExe.stop();
}
}
代码示例来源:origin: zscott/MultiBitExchange
public Mongo newMongo() throws UnknownHostException, MongoException {
return new Mongo(new ServerAddress(
mongodProcess.getConfig().net().getServerAddress(),
mongodProcess.getConfig().net().getPort()));
}
代码示例来源:origin: com.github.joelittlejohn.embedmongo/embedmongo-maven-plugin
@Override
public void executeStart() throws MojoExecutionException, MojoFailureException {
MongodProcess mongod = (MongodProcess) getPluginContext().get(StartMojo.MONGOD_CONTEXT_PROPERTY_NAME);
if (mongod != null) {
mongod.stop();
} else {
throw new MojoFailureException("No mongod process found, it appears embedmongo:start was not called");
}
}
代码示例来源:origin: de.flapdoodle.embed/de.flapdoodle.embed.mongo
@Override
protected List<String> getCommandLine(Distribution distribution, IMongodConfig config, IExtractedFileSet files) throws IOException {
return Mongod.enhanceCommandLinePlattformSpecific(distribution, Mongod.getCommandLine(getConfig(), files, dbDir));
}
代码示例来源:origin: joelittlejohn/embedmongo-maven-plugin
@Override
public void executeStart() throws MojoExecutionException, MojoFailureException {
MongodProcess mongod = (MongodProcess) getPluginContext().get(StartMojo.MONGOD_CONTEXT_PROPERTY_NAME);
if (mongod != null) {
mongod.stop();
} else {
throw new MojoFailureException("No mongod process found, it appears embedmongo:start was not called");
}
}
代码示例来源:origin: eclipse/ditto
/**
* @return the port on which the db listens.
*/
public int getPort() {
return mongodProcess.getConfig().net().getPort();
}
代码示例来源:origin: otto-de/edison-microservice
public static void stopMongoDB() {
if (mongodProcess != null) {
mongodProcess.stop();
}
if (mongodExecutable != null) {
mongodExecutable.stop();
}
started.set(false);
}
代码示例来源:origin: eclipse/ditto
/**
* @return the IP on which the db was bound.
*/
public String getBindIp() {
return mongodProcess.getConfig().net().getBindIp();
}
代码示例来源:origin: org.apache.rya/mongodb.rya
/**
* Cleans up the resources created by the utility.
*/
public void shutdown() {
mongodProcess.stop();
mongodExecutable.stop();
}
}
代码示例来源:origin: de.flapdoodle.embed/de.flapdoodle.embed.mongo
@Override
protected void onBeforeProcess(IRuntimeConfig runtimeConfig) throws IOException {
super.onBeforeProcess(runtimeConfig);
IMongodConfig config = getConfig();
File tmpDbDir;
if (config.replication().getDatabaseDir() != null) {
tmpDbDir = Files.createOrCheckDir(config.replication().getDatabaseDir());
} else {
tmpDbDir = Files.createTempDir(PropertyOrPlatformTempDir.defaultInstance(),"embedmongo-db");
dbDirIsTemp = true;
}
this.dbDir = tmpDbDir;
}
内容来源于网络,如有侵权,请联系作者删除!