|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opends.server.api.WorkQueue<T>
T
- The type of configuration handled by this work queue.@PublicAPI(stability=VOLATILE, mayInstantiate=false, mayExtend=true, mayInvoke=true) public abstract class WorkQueue<T extends WorkQueueCfg>
This class defines the structure and methods that must be implemented by a Directory Server work queue. The work queue is the component of the server that accepts requests from connection handlers and ensures that they are properly processed. The manner in which the work queue is able to accomplish this may vary between implementations, but in general it is assumed that one or more worker threads will be associated with the queue and may be used to process requests in parallel.
Constructor Summary | |
---|---|
WorkQueue()
|
Method Summary | |
---|---|
abstract void |
finalizeWorkQueue(Message reason)
Performs any necessary finalization for this work queue, including ensuring that all active operations are interrupted or will be allowed to complete, and that all pending operations will be cancelled. |
abstract void |
initializeWorkQueue(T configuration)
Initializes this work queue based on the information in the provided configuration entry. |
abstract boolean |
isIdle()
Indicates whether the work queue is currently processing any requests. |
abstract void |
submitOperation(AbstractOperation operation)
Submits an operation to be processed in the server. |
boolean |
waitUntilIdle(long timeLimit)
Waits for the work queue to become idle before returning. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public WorkQueue()
Method Detail |
---|
public abstract void initializeWorkQueue(T configuration) throws ConfigException, InitializationException
configuration
- The configuration to use to initialize
the work queue.
ConfigException
- If the provided configuration entry
does not have a valid work queue
configuration.
InitializationException
- If a problem occurs during
initialization that is not
related to the server
configuration.public abstract void finalizeWorkQueue(Message reason)
reason
- The human-readable reason that the work queue is
being shut down.public abstract void submitOperation(AbstractOperation operation) throws DirectoryException
operation
- The operation to be processed.
DirectoryException
- If the provided operation is not
accepted for some reason (e.g., if
the server is shutting down or
already has too many pending
requests in the queue).public abstract boolean isIdle()
true
if the work queue is currently idle, or
false
if it is being used to process one or more
operations.public boolean waitUntilIdle(long timeLimit)
timeLimit
- The maximum length of time in milliseconds
that this method should wait for the queue to
become idle before giving up. A time limit
that is less than or equal to zero indicates
that there should not be a time limit.
true
if the work queue is idle at the time that
this method returns, or false
if the wait time
limit was reached before the server became idle.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |