From 582344d280d24dfec999b862d8255eb077995b99 Mon Sep 17 00:00:00 2001
From: Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Tue, 26 Mar 2013 14:49:27 +0000
Subject: [PATCH] OPENDJ-832 Leverage the work queue for processing requests received on the HTTP connection handler 

---
 opends/src/server/org/opends/server/extensions/TraditionalWorkerThread.java |   35 ++++++++++++++++++++---------------
 1 files changed, 20 insertions(+), 15 deletions(-)

diff --git a/opends/src/server/org/opends/server/extensions/TraditionalWorkerThread.java b/opends/src/server/org/opends/server/extensions/TraditionalWorkerThread.java
index c492e34..bc73665 100644
--- a/opends/src/server/org/opends/server/extensions/TraditionalWorkerThread.java
+++ b/opends/src/server/org/opends/server/extensions/TraditionalWorkerThread.java
@@ -23,25 +23,24 @@
  *
  *
  *      Copyright 2006-2010 Sun Microsystems, Inc.
- *      Portions copyright 2011 ForgeRock AS
+ *      Portions copyright 2011-2013 ForgeRock AS
  */
 package org.opends.server.extensions;
-import org.opends.messages.Message;
-
 
 
 import java.util.Map;
 
+import org.opends.messages.Message;
 import org.opends.server.api.DirectoryThread;
 import org.opends.server.core.DirectoryServer;
-import org.opends.server.types.AbstractOperation;
+import org.opends.server.loggers.debug.DebugTracer;
 import org.opends.server.types.CancelRequest;
 import org.opends.server.types.DebugLogLevel;
 import org.opends.server.types.DisconnectReason;
+import org.opends.server.types.Operation;
 
 import static org.opends.server.loggers.ErrorLogger.*;
 import static org.opends.server.loggers.debug.DebugLogger.*;
-import org.opends.server.loggers.debug.DebugTracer;
 import static org.opends.messages.CoreMessages.*;
 import static org.opends.server.util.StaticUtils.*;
 
@@ -58,24 +57,28 @@
    */
   private static final DebugTracer TRACER = getTracer();
 
-  // Indicates whether the Directory Server is shutting down and this thread
-  // should stop running.
+  /**
+   * Indicates whether the Directory Server is shutting down and this thread
+   * should stop running.
+   */
   private volatile boolean shutdownRequested;
 
-  // Indicates whether this thread was stopped because the server threadnumber
-  // was reduced.
+  /**
+   * Indicates whether this thread was stopped because the server threadnumber
+   * was reduced.
+   */
   private boolean stoppedByReducedThreadNumber;
 
-  // Indicates whether this thread is currently waiting for work.
+  /** Indicates whether this thread is currently waiting for work. */
   private boolean waitingForWork;
 
-  // The operation that this worker thread is currently processing.
-  private AbstractOperation operation;
+  /** The operation that this worker thread is currently processing. */
+  private Operation operation;
 
-  // The handle to the actual thread for this worker thread.
+  /** The handle to the actual thread for this worker thread. */
   private Thread workerThread;
 
-  // The work queue that this worker thread will service.
+  /** The work queue that this worker thread will service. */
   private TraditionalWorkQueue workQueue;
 
 
@@ -136,6 +139,7 @@
    * Operates in a loop, retrieving the next request from the work queue,
    * processing it, and then going back to the queue for more.
    */
+  @Override
   public void run()
   {
     workerThread = currentThread();
@@ -279,7 +283,7 @@
     {
       try
       {
-        final AbstractOperation localOperation = operation;
+        final Operation localOperation = operation;
         if (localOperation != null)
         {
           CancelRequest cancelRequest = new CancelRequest(true,
@@ -306,6 +310,7 @@
    *
    * @return debug information about this thread as a string.
    */
+  @Override
   public Map<String, String> getDebugProperties()
   {
     Map<String, String> properties = super.getDebugProperties();

--
Gitblit v1.10.0