base/common/src/main/com/thesett/common/util/queues/WrapperQueue.java
public E pollAcquire(Object owner)
    {
        E element;

        // Find an element on the requeue that is free and return it.
        if (!requeue.isEmpty())
        {
            for (RequeueElementWrapper<E> nextRecord : requeue)
            {
                if (AcquireState.Free.equals(nextRecord.state))
                {
                    nextRecord.state = AcquireState.Acquired;
                    nextRecord.owner = owner;

                    return nextRecord.element;
                }
            }
        }

        // Nothing could be found on the requeue, so attempt to poll an element off the main queue and acquire
        // it on the requeue.
        element = queue.poll();

        if (element != null)
        {
            requeue(element, owner, AcquireState.Acquired);
        }

        return element;
    }
public E pollAcquire(Object owner)
    {
        E element;

        // Find an element on the requeue that is free and return it.
        if (!requeue.isEmpty())
        {
            for (RequeueElementWrapper<E> nextRecord : requeue)
            {
                if (AcquireState.Free.equals(nextRecord.state))
                {
                    nextRecord.state = AcquireState.Acquired;
                    nextRecord.owner = owner;

                    return nextRecord.element;
                }
            }
        }

        // Nothing could be found on the requeue, so attempt to poll an element off the main queue and acquire
        // it on the requeue.
        element = queue.poll();

        if (element != null)
        {
            requeue(element, owner, AcquireState.Acquired);
        }

        return element;
    }
public E pollAcquire ( Object owner ) { E element ; // Find an element on the requeue that is free and return it. if ( ! requeue . isEmpty ( ) ) { for ( RequeueElementWrapper < E > nextRecord : requeue ) { if ( AcquireState . Free . equals ( nextRecord . state ) ) { nextRecord . state = AcquireState . Acquired ; nextRecord . owner = owner ; return nextRecord . element ; } } } // Nothing could be found on the requeue, so attempt to poll an element off the main queue and acquire // it on the requeue. element = queue . poll ( ) ; if ( element != null ) { requeue ( element , owner , AcquireState . Acquired ) ; } return element ; }
{@inheritDoc}
{