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

Jean-Noël Rouvignac
20.42.2016 61b9eb1be03fc03a9f4bb0013a08ff44a1059503
opendj-server-legacy/src/main/java/org/opends/server/extensions/TraditionalWorkQueue.java
@@ -16,8 +16,6 @@
 */
package org.opends.server.extensions;
import static org.opends.messages.ConfigMessages.*;
import static org.opends.messages.CoreMessages.*;
@@ -45,8 +43,6 @@
import org.opends.server.types.InitializationException;
import org.opends.server.types.Operation;
/**
 * This class defines a data structure for storing and interacting with the
 * Directory Server work queue.
@@ -112,16 +108,10 @@
  /** The queue that will be used to actually hold the pending operations. */
  private LinkedBlockingQueue<Operation> opQueue;
  /**
   * The lock used to provide threadsafe access for the queue, used for
   * non-config changes.
   */
  /** The lock used to provide threadsafe access for the queue, used for non-config changes. */
  private final ReadLock queueReadLock;
  /**
   * The lock used to provide threadsafe access for the queue, used for config
   * changes.
   */
  /** The lock used to provide threadsafe access for the queue, used for config changes. */
  private final WriteLock queueWriteLock;
  {
    ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
@@ -129,8 +119,6 @@
    queueWriteLock = lock.writeLock();
  }
  /**
   * Creates a new instance of this work queue. All initialization should be
   * performed in the <CODE>initializeWorkQueue</CODE> method.
@@ -140,9 +128,6 @@
    // No implementation should be performed here.
  }
  /** {@inheritDoc} */
  @Override
  public void initializeWorkQueue(TraditionalWorkQueueCfg configuration)
      throws ConfigException, InitializationException
@@ -206,9 +191,6 @@
    }
  }
  /** {@inheritDoc} */
  @Override
  public void finalizeWorkQueue(LocalizableMessage reason)
  {
@@ -262,8 +244,6 @@
    }
  }
  /**
   * Indicates whether this work queue has received a request to shut down.
   *
@@ -283,8 +263,6 @@
    }
  }
  /**
   * Submits an operation to be processed by one of the worker threads
   * associated with this work queue.
@@ -302,7 +280,6 @@
    submitOperation(operation, isBlocking);
  }
  /** {@inheritDoc} */
  @Override
  public boolean trySubmitOperation(Operation operation)
      throws DirectoryException
@@ -389,8 +366,6 @@
    }
  }
  /**
   * Retrieves the next operation that should be processed by one of the worker
   * threads, blocking if necessary until a new request arrives. This method
@@ -407,8 +382,6 @@
    return retryNextOperation(workerThread, 0);
  }
  /**
   * Retrieves the next operation that should be processed by one of the worker
   * threads following a previous failure attempt. A maximum of five consecutive
@@ -512,8 +485,6 @@
    return retryNextOperation(workerThread, numFailures + 1);
  }
  /**
   * Kills this worker thread if needed. This method assumes that the read lock
   * is already taken and ensure that it is taken on exit.
@@ -568,8 +539,6 @@
    return false;
  }
  /**
   * Retrieves the total number of operations that have been successfully
   * submitted to this work queue for processing since server startup. This does
@@ -584,8 +553,6 @@
    return opsSubmitted.longValue();
  }
  /**
   * Retrieves the total number of operations that have been rejected because
   * the work queue was already at its maximum capacity.
@@ -598,8 +565,6 @@
    return queueFullRejects.longValue();
  }
  /**
   * Retrieves the number of pending operations in the queue that have not yet
   * been picked up for processing. Note that this method is not a constant-time
@@ -622,9 +587,6 @@
    }
  }
  /** {@inheritDoc} */
  @Override
  public boolean isConfigurationChangeAcceptable(
      TraditionalWorkQueueCfg configuration, List<LocalizableMessage> unacceptableReasons)
@@ -632,9 +594,6 @@
    return true;
  }
  /** {@inheritDoc} */
  @Override
  public ConfigChangeResult applyConfigurationChange(
      TraditionalWorkQueueCfg configuration)
@@ -680,7 +639,6 @@
      }
    }
    // Apply a change to the maximum capacity if appropriate. Since we can't
    // change capacity on the fly, then we'll have to create a new queue and
    // transfer any remaining items into it. Any thread that is waiting on the
@@ -753,9 +711,6 @@
    return new ConfigChangeResult();
  }
  /** {@inheritDoc} */
  @Override
  public boolean isIdle()
  {