mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

gbellato
25.29.2007 0eab55fa49863935bbc81242b7e13fa550fedc6d
opends/src/server/org/opends/server/replication/plugin/ReplicationDomain.java
@@ -245,6 +245,12 @@
  private DN configDn;
  /**
   * A boolean indicating if the thread used to save the persistentServerState
   * is terminated.
   */
  private boolean done = false;
  /**
   * This class contain the context related to an import or export
   * launched on the domain.
   */
@@ -1207,6 +1213,8 @@
      { }
    }
    state.save();
    done = true;
  }
  /**
@@ -1216,12 +1224,18 @@
   */
  private void createListeners()
  {
    synchroThreads.clear();
    for (int i=0; i<listenerThreadNumber; i++)
    synchronized (synchroThreads)
    {
      ListenerThread myThread = new ListenerThread(this);
      myThread.start();
      synchroThreads.add(myThread);
      if (!shutdown)
      {
        synchroThreads.clear();
        for (int i=0; i<listenerThreadNumber; i++)
        {
          ListenerThread myThread = new ListenerThread(this);
          myThread.start();
          synchroThreads.add(myThread);
        }
      }
    }
  }
@@ -1230,14 +1244,18 @@
   */
  public void shutdown()
  {
    // stop the listener threads
    for (ListenerThread thread : synchroThreads)
    {
      thread.shutdown();
    }
    // stop the flush thread
    shutdown = true;
    synchronized (synchroThreads)
    {
      // stop the listener threads
      for (ListenerThread thread : synchroThreads)
      {
        thread.shutdown();
      }
    }
    synchronized (this)
    {
      this.notify();
@@ -1253,7 +1271,19 @@
    //  wait for the listener thread to stop
    for (ListenerThread thread : synchroThreads)
    {
      thread.shutdown();
      thread.waitForShutdown();
    }
    // wait for completion of the persistentServerState thread.
    try
    {
      while (!done)
      {
        Thread.sleep(50);
      }
    } catch (InterruptedException e)
    {
      // stop waiting when interrupted.
    }
  }
@@ -2249,7 +2279,7 @@
   */
  public long computeGenerationId() throws DirectoryException
  {
    Backend backend = this.retrievesBackend(baseDN);
    Backend backend = retrievesBackend(baseDN);
    long bec = backend.getEntryCount();
    this.acquireIEContext();
    ieContext.checksumOutput = true;
@@ -3049,7 +3079,7 @@
    LDIFImportConfig importConfig = null;
    DirectoryException de = null;
    Backend backend = this.retrievesBackend(baseDN);
    Backend backend = retrievesBackend(baseDN);
    if (!backend.supportsLDIFImport())
    {