Package org.opends.server.core
Class BoundedWorkQueueStrategy
- java.lang.Object
-
- org.opends.server.core.BoundedWorkQueueStrategy
-
- All Implemented Interfaces:
QueueingStrategy
public class BoundedWorkQueueStrategy extends Object implements QueueingStrategy
A QueueingStrategy that concurrently enqueues a bounded number of operations to the DirectoryServer work queue. If the maximum number of concurrently enqueued operations has been reached or if the work queue if full, then the operation will be executed on the current thread.
-
-
Constructor Summary
Constructors Constructor Description BoundedWorkQueueStrategy(Integer maxNbConcurrentOperations, ServerContext serverContext)
Constructor for BoundedWorkQueueStrategy.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
enqueueRequest(Operation operation)
Put the request in the queue.protected boolean
tryEnqueueRequest(Operation op)
Tries to add the provided operation to the work queue if not full so that it will be processed by one of the worker threads.
-
-
-
Constructor Detail
-
BoundedWorkQueueStrategy
public BoundedWorkQueueStrategy(Integer maxNbConcurrentOperations, ServerContext serverContext)
Constructor for BoundedWorkQueueStrategy.- Parameters:
maxNbConcurrentOperations
- the maximum number of operations that can be concurrently enqueued to the DirectoryServer work queueserverContext
- the server context
-
-
Method Detail
-
enqueueRequest
public void enqueueRequest(Operation operation) throws LdapException
Description copied from interface:QueueingStrategy
Put the request in the queue.- Specified by:
enqueueRequest
in interfaceQueueingStrategy
- Parameters:
operation
- Operation to put in the queue.- Throws:
LdapException
- If a problem occurs in the Directory Server.
-
tryEnqueueRequest
protected boolean tryEnqueueRequest(Operation op) throws LdapException
Tries to add the provided operation to the work queue if not full so that it will be processed by one of the worker threads.- Parameters:
op
- The operation to be added to the work queue.- Returns:
- true if the operation could be enqueued, false otherwise
- Throws:
LdapException
- If a problem prevents the operation from being added to the queue (e.g., the queue is full).
-
-