@PublicAPI(stability=VOLATILE, mayInstantiate=true, mayExtend=true, mayInvoke=true) public class DirectoryThread extends Thread
Modifier and Type | Class and Description |
---|---|
static class |
DirectoryThread.Factory
A factory which can be used by thread pool based services such as
Executor s to dynamically create new
DirectoryThread instances. |
Thread.State, Thread.UncaughtExceptionHandler
Modifier and Type | Field and Description |
---|---|
static org.opends.server.api.DirectoryThread.DirectoryThreadGroup |
DIRECTORY_THREAD_GROUP
The directory thread group that all directory threads will be a
member of.
|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
Modifier | Constructor and Description |
---|---|
|
DirectoryThread(Runnable target,
String threadName)
Creates a new instance of this directory thread with the
specified name and with the specified target as its run object.
|
protected |
DirectoryThread(String threadName)
Creates a new instance of this directory thread with the
specified name.
|
Modifier and Type | Method and Description |
---|---|
Task |
getAssociatedTask()
Retrieves the task with which this thread is associated.
|
StackTraceElement[] |
getCreationStackTrace()
Retrieves the stack trace that was captured at the time that this
thread was created.
|
Map<String,String> |
getDebugProperties()
Retrieves any relevant debug information with which this tread is
associated so they can be included in debug messages.
|
Thread |
getParentThread()
Retrieves a reference to the parent thread that created this
directory thread.
|
void |
initiateShutdown()
Instructs the current thread to initiate the shutdown process.
|
boolean |
isShutdownInitiated()
Returns whether the shutdown process has been initiated on the current
thread.
|
void |
setAssociatedTask(Task task)
Sets the task with which this thread is associated.
|
void |
startWork()
Sets the current thread state to "processing" if the shutdown process was
not initiated.
|
void |
stopWork()
Sets the current thread state to "idle" if the shutdown process was not
initiated.
|
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, run, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
public static final org.opends.server.api.DirectoryThread.DirectoryThreadGroup DIRECTORY_THREAD_GROUP
public DirectoryThread(Runnable target, String threadName)
target
- The target runnable object.threadName
- The human-readable name to use for this
thread for debugging purposes.protected DirectoryThread(String threadName)
threadName
- The human-readable name to use for this
thread for debugging purposes.public StackTraceElement[] getCreationStackTrace()
public Thread getParentThread()
public Task getAssociatedTask()
null
if there is none.public void setAssociatedTask(Task task)
null
to indicate that it is not associated with any task.task
- The task with which this thread is associated.public Map<String,String> getDebugProperties()
public boolean isShutdownInitiated()
Waiting for the thread to terminate should be done by invoking one of the
Thread.join()
methods.
public void initiateShutdown()
Thread.run()
method.public void startWork()
public void stopWork()
Copyright 2010-2017 ForgeRock AS.