org.opends.server.extensions
Class TraditionalWorkerThread

java.lang.Object
  extended by java.lang.Thread
      extended by org.opends.server.api.DirectoryThread
          extended by org.opends.server.extensions.TraditionalWorkerThread
All Implemented Interfaces:
java.lang.Runnable

public class TraditionalWorkerThread
extends DirectoryThread

This class defines a data structure for storing and interacting with a Directory Server worker thread.


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
TraditionalWorkerThread(TraditionalWorkQueue workQueue, int threadID)
          Creates a new worker thread that will service the provided work queue and process any new requests that are submitted.
 
Method Summary
 java.util.Map<java.lang.String,java.lang.String> getDebugProperties()
          Retrieves any relevent debug information with which this tread is associated so they can be included in debug messages.
 boolean isActive()
          Indicates whether this worker thread is actively processing a request.
 void run()
          Operates in a loop, retrieving the next request from the work queue, processing it, and then going back to the queue for more.
 void setStoppedByReducedThreadNumber()
          Indicates that this thread is about to be stopped because the Directory Server configuration has been updated to reduce the number of worker threads.
 void shutDown()
          Indicates that the Directory Server has received a request to stop running and that this thread should stop running as soon as possible.
 
Methods inherited from class org.opends.server.api.DirectoryThread
getAssociatedTask, getCreationStackTrace, getParentThread, setAssociatedTask
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TraditionalWorkerThread

public TraditionalWorkerThread(TraditionalWorkQueue workQueue,
                               int threadID)
Creates a new worker thread that will service the provided work queue and process any new requests that are submitted.

Parameters:
workQueue - The work queue with which this worker thread is associated.
threadID - The thread ID for this worker thread.
Method Detail

setStoppedByReducedThreadNumber

public void setStoppedByReducedThreadNumber()
Indicates that this thread is about to be stopped because the Directory Server configuration has been updated to reduce the number of worker threads.


isActive

public boolean isActive()
Indicates whether this worker thread is actively processing a request. Note that this is a point-in-time determination and if a reliable answer is expected then the server should impose some external constraint to ensure that no new requests are enqueued.

Returns:
true if this worker thread is actively processing a request, or false if it is idle.

run

public void run()
Operates in a loop, retrieving the next request from the work queue, processing it, and then going back to the queue for more.

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

shutDown

public void shutDown()
Indicates that the Directory Server has received a request to stop running and that this thread should stop running as soon as possible.


getDebugProperties

public java.util.Map<java.lang.String,java.lang.String> getDebugProperties()
Retrieves any relevent debug information with which this tread is associated so they can be included in debug messages.

Overrides:
getDebugProperties in class DirectoryThread
Returns:
debug information about this thread as a string.