de.flapdoodle.embed.mongo.MongodProcess.stop()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(4.7k)|赞(0)|评价(0)|浏览(77)

本文整理了Java中de.flapdoodle.embed.mongo.MongodProcess.stop()方法的一些代码示例,展示了MongodProcess.stop()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。MongodProcess.stop()方法的具体详情如下:
包路径:de.flapdoodle.embed.mongo.MongodProcess
类名称:MongodProcess
方法名:stop

MongodProcess.stop介绍

暂无

代码示例

代码示例来源: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: kaaproject/kaa

public static void tearDown() throws Exception {
 mongod.stop();
 mongoDBExec.stop();
}

代码示例来源: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: com.github.mlk/assortmentofjunitrules

@Override
public void after() {
 if (this.mongod != null) {
  this.mongod.stop();
  this.mongodExe.stop();
 }
}

代码示例来源: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: de.flapdoodle.embed/de.flapdoodle.embed.mongo

/**
   * Cleans up the resources created by the utility.
   */
  public void shutdown() {
    mongodProcess.stop();
    mongodExecutable.stop();
  }
}

代码示例来源: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: otto-de/edison-microservice

public static void stopMongoDB() {
  if (mongodProcess != null) {
    mongodProcess.stop();
  }
  if (mongodExecutable != null) {
    mongodExecutable.stop();
  }
  started.set(false);
}

代码示例来源:origin: org.apache.rya/mongodb.rya

/**
   * Cleans up the resources created by the utility.
   */
  public void shutdown() {
    mongodProcess.stop();
    mongodExecutable.stop();
  }
}

代码示例来源:origin: apache/incubator-rya

/**
   * Cleans up the resources created by the utility.
   */
  public void shutdown() {
    mongodProcess.stop();
    mongodExecutable.stop();
  }
}

代码示例来源:origin: sakserv/hadoop-mini-clusters

@Override
public void stop(boolean cleanUp) throws Exception {
  LOG.info("MONGODB: Stopping MongoDB on {}:{}", ip, port);
  mongod.stop();
  mongodExe.stop();
  if(cleanUp) {
    cleanUp();
  }
}

代码示例来源:origin: com.github.sakserv/hadoop-mini-clusters-mongodb

@Override
public void stop(boolean cleanUp) throws Exception {
  LOG.info("MONGODB: Stopping MongoDB on {}:{}", ip, port);
  mongod.stop();
  mongodExe.stop();
  if(cleanUp) {
    cleanUp();
  }
}

代码示例来源:origin: georocket/georocket

/**
  * Stop MongoDB instance
  */
 public void stop() {
  mongod.stop();
  mongodExe.stop();
 }
}

代码示例来源:origin: eclipse/ditto

@Override
protected void after() {
  if (mongodProcess != null) {
    mongodProcess.stop();
  }
  if (mongodExecutable != null) {
    mongodExecutable.stop();
  }
}

代码示例来源:origin: apache/eagle

public void shutdown() {
  if (mongod != null) {
    try {
      mongod.stop();
    }
    catch (IllegalStateException e) {
      // catch this exception for the unstable stopping mongodb
      // reason: the exception is usually thrown out with below message format when stop() returns null value,
      //         but actually this should have been captured in ProcessControl.stopOrDestroyProcess() by destroying
      //         the process ultimately
      if (e.getMessage() != null && e.getMessage().matches("^Couldn't kill.*process!.*")) {
        // if matches, do nothing, just ignore the exception
      } else {
        LOG.warn(String.format("Ignored error for stopping mongod process, see stack trace: %s", ExceptionUtils.getStackTrace(e)));
      }
    }
    mongodExe.stop();
  }
}

代码示例来源:origin: restx/restx

@Override
  public void evaluate() throws Throwable {
    MongodExecutable _mongodExe = runtime
        .prepare(new MongodConfigBuilder()
            .version(mongoVersion)
            .net(new Net(Integer.parseInt(mongoClientURI
                .getURI().split(":")[2]), false))
            .build());
    MongodProcess _mongod = _mongodExe.start();
    MongoClient mongoClient = new MongoClient(mongoClientURI);
    base.evaluate();
    mongoClient.close();
    _mongod.stop();
    _mongodExe.stop();
  }
};

代码示例来源:origin: ModeShape/modeshape

@AfterClass
public static void tearDownClass() throws Exception {
  try {
    binaryStore.shutdown();
    mongodExecutable.stop();
    mongodProcess.stop();
  } catch (Throwable t) {
    //ignore
  }
}

代码示例来源:origin: atlanmod/NeoEMF

/**
 * Closes the cluster and cleans all resources related to it.
 */
private static void close() {
  try {
    Log.info("Shutting down the MongoDB cluster...");
    mongoProcess.stop();
    mongoExecutable.stop();
    reset();
  }
  catch (Throwable ignored) {
  }
}

相关文章

微信公众号

最新文章

更多