Package org.opends.server.extensions
Class ParallelWorkerThread
- java.lang.Object
-
- java.lang.Thread
-
- org.opends.server.api.DirectoryThread
-
- org.opends.server.extensions.ParallelWorkerThread
-
- All Implemented Interfaces:
Runnable
public class ParallelWorkerThread 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 org.opends.server.api.DirectoryThread
DirectoryThread.Factory
-
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
-
-
Field Summary
-
Fields inherited from class org.opends.server.api.DirectoryThread
DIRECTORY_THREAD_GROUP
-
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
-
-
Constructor Summary
Constructors Constructor Description ParallelWorkerThread(ParallelWorkQueue 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<String,String>getDebugProperties()Retrieves any relevent debug information with which this tread is associated so they can be included in debug messages.booleanisActive()Indicates whether this worker thread is actively processing a request.voidrun()Operates in a loop, retrieving the next request from the work queue, processing it, and then going back to the queue for more.voidsetStoppedByReducedThreadNumber()Indicates that this thread is about to be stopped because the Directory Server configuration has been updated to reduce the number of worker threads.voidshutDown()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, initiateShutdown, isShutdownInitiated, setAssociatedTask, startWork, stopWork
-
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
-
-
-
-
Constructor Detail
-
ParallelWorkerThread
public ParallelWorkerThread(ParallelWorkQueue 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:
trueif this worker thread is actively processing a request, orfalseif 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.
-
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 Map<String,String> getDebugProperties()
Retrieves any relevent debug information with which this tread is associated so they can be included in debug messages.- Overrides:
getDebugPropertiesin classDirectoryThread- Returns:
- debug information about this thread as a string.
-
-