Example #1
0
  private void createEngineThread() {
    if (engineThread != null && engineThread.isAlive()) return;

    if (engineThread != null && !engineThread.isAlive())
      throw new RuntimeException(Messages.getString(Messages.LocalRepository.EngineThread_Died));

    engineThread = new ModeshapeEngineThread(getId());
    engineThread.start();
  }
Example #2
0
  private void startRepository() {
    if (this.state == State.REACHABLE) return;

    createEngineThread();

    RequestCallback callback =
        new RequestCallback() {

          @Override
          public void errorOccurred(final Throwable error) {
            throw new RuntimeException(error);
          }

          @Override
          public void respond(final Object results) {
            if (engineThread.isRunning()) {
              LocalRepository.this.state = State.REACHABLE;
              notifyObservers();
            }
          }
        };

    KLog.getLogger()
        .debug("LocalRepository.startRepository() post start repository request"); // $NON-NLS-1$
    engineThread.accept(new Request(RequestType.START, callback));
  }