Class 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 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 queue
        serverContext - the server context
    • Method Detail

      • 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).