Пример #1
0
 private boolean commit(
     LockID lockID, ClientTransaction currentTransaction, boolean isWaitContext) {
   try {
     return commitInternal(lockID, currentTransaction, isWaitContext);
   } catch (Throwable t) {
     remoteTxManager.stopProcessing();
     Banner.errorBanner("Terracotta client shutting down due to error " + t);
     logger.error(t);
     if (t instanceof Error) {
       throw (Error) t;
     }
     if (t instanceof RuntimeException) {
       throw (RuntimeException) t;
     }
     throw new RuntimeException(t);
   }
 }
Пример #2
0
  public void stop() throws Exception {
    System.err.println("Stopping instance on port " + httpPort + "...");

    File stopScript = getInstanceFile("bin/" + getPlatformScript("stopserv"));
    Result result =
        Exec.execute(
            new String[] {stopScript.getAbsolutePath()}, null, null, stopScript.getParentFile());
    if (result.getExitCode() != 0) {
      System.err.println(result);
    }

    if (runner != null) {
      runner.join(START_STOP_TIMEOUT);
    }

    if (runner.isAlive()) {
      Banner.errorBanner("instance still running on port " + httpPort);
    } else {
      System.err.println("Stopped instance on port " + httpPort);
    }
  }