<p>Removes the queued {@link ServerRequest} object at position with index 0 within the queue,
and returns it as a result.</p>

@return The {@link ServerRequest} object at position with index 0 within the queue.
540062
ServerRequest dequeue() {
        ServerRequest req = null;
        synchronized (reqQueueLockObject) {
            try {
                req = queue.remove(0);
                persist();
            } catch (IndexOutOfBoundsException | NoSuchElementException ignored) {
            }
        }
        return req;
    }
581836
public static Buffer getQueue(int size) {

        if (CmsLog.INIT.isInfoEnabled()) {
            CmsLog.INIT.info(
                Messages.get().getBundle().key(Messages.INIT_PUBLISH_HISTORY_SIZE_SET_1, new Integer(size)));
        }

        return BufferUtils.synchronizedBuffer(TypedBuffer.decorate(new CircularFifoBuffer(size) {

            /** The serialization version id constant. */
            private static final long serialVersionUID = -6257542123241183114L;

            /**
             * Called when the queue is full to remove the oldest element.<p>
             *
             * @see org.apache.commons.collections.buffer.BoundedFifoBuffer#remove()
             */
            @Override
            public Object remove() {

                CmsPublishJobInfoBean publishJob = (CmsPublishJobInfoBean)super.remove();
                try {
                    OpenCms.getPublishManager().getEngine().getPublishHistory().remove(publishJob);
                } catch (CmsException exc) {
                    if (LOG.isErrorEnabled()) {
                        LOG.error(exc.getLocalizedMessage(), exc);
                    }
                }
                return publishJob;
            }
        }, CmsPublishJobInfoBean.class));
    }
947120
private AsyncResourceRequest<V> getNextUnexpiredResourceRequest(Queue<AsyncResourceRequest<V>> requestQueue) {
        AsyncResourceRequest<V> resourceRequest = requestQueue.poll();
        while(resourceRequest != null) {
            if(resourceRequest.getDeadlineNs() < System.nanoTime()) {
                resourceRequest.handleTimeout();
                resourceRequest = requestQueue.poll();
            } else {
                break;
            }
        }
        return resourceRequest;
    }
1106107
public E remove(){
        E head = queue.poll();      // remove head from queue
        if(head != null){
            set.remove(head);       // also remove this element from the hash set
        }
        return head;
    }
237887
@Override
    public final T remove() {
        // Short circuit using read-lock
        if (this.isEmpty()) {
            throw new NoSuchElementException();
        }

        final T e = this.poll();
        if (e == null) {
            throw new NoSuchElementException();
        }
        return e;
    }
1001377
public ByteArrayQueue remove(byte[] b, int off, int len) {
		System.arraycopy(array, offset, b, off, len);
		return remove(len);
	}
828288
public OperationFuture<List<Server>> revertToSnapshot(Server... servers) {
        List<Server> serverList = Arrays.asList(servers);

        List<JobFuture> futures = serverList.stream()
            .map(this::findByRef)
            .flatMap(metadata -> metadata.getDetails().getSnapshots().stream())
            .map(snapshot ->
                baseServerResponse(
                    client.revertToSnapshot(snapshot.getServerId(), snapshot.getId())
                )
                .jobFuture()
            )
            .collect(toList());

        return new OperationFuture<>(
            serverList,
            new ParallelJobsFuture(futures)
        );
    }
1206596
public T remove()
    {
        if ( size == 0 ) {
            return null;
        }
        
        //remove the first element
        Entry<T> o = head.next;
        head.next   = o.next;
        o.next.prev = head;
        
        //bakup the data
        T v         = o.data;
        size--;
        index.remove(v.getValue());
        
        o = null;            //Let gc do its work
        
        return v;
    }
351966
public void removeServer(InternalInstrumented<ServerStats> server) {
    remove(servers, server);
    ServerSocketMap prev = perServerSockets.remove(id(server));
    assert prev != null;
    assert prev.isEmpty();
  }
182781
@Override
    public T remove() {

        T retrievedElement = poll();

        if (retrievedElement == null) {
            throw new NoSuchElementException();
        }

        return retrievedElement;
    }
144923
public static String getServerHost() {
        String ret = getLatkeProperty("serverHost");
        if (null == ret) {
            final RequestContext requestContext = REQUEST_CONTEXT.get();
            if (null != requestContext) {
                ret = requestContext.getRequest().getServerName();
            } else {
                initPublicIP();

                return PUBLIC_IP;
            }
        }

        return ret;
    }
1070565
@SuppressWarnings("unchecked")
	public synchronized List<T> removeAllNoOrder() {
		if (end == -1) {
			List<Object> a = Arrays.asList(array);
			array = new Object[array.length];
			start = end = 0;
			return (List<T>)a;
		}
		if (start == end) return Collections.EMPTY_LIST;
		if (end > start) {
			Object[] a = new Object[end - start];
			System.arraycopy(array, start, a, 0, end - start);
			for (int i = start; i < end; ++i) array[i] = null;
			start = end = 0;
			return (List<T>)Arrays.asList(a);
		}
		Object[] a = new Object[array.length - start + end];
		System.arraycopy(array, start, a, 0, array.length - start);
		if (end > 0)
			System.arraycopy(array, 0, a, array.length - start, end);
		for (int i = array.length - 1; i >= 0; --i) array[i] = null;
		start = end = 0;
		return (List<T>)Arrays.asList(a);
	}
1139276
public QueryResult<T> first() {
        if (response != null && response.size() > 0) {
            return response.get(0);
        }
        return null;
    }
166959
public static URI removeServer(URI uri) {
        try {
            return new URI(null, null, null, -1, uri.getPath(), uri.getQuery(), uri.getFragment());
        } catch (URISyntaxException e) {
            throw new InvalidUriException(e);
        }

    }
264677
@Nullable
	private PendingRequest removePendingRequest(SlotRequestId requestId) {
		PendingRequest result = waitingForResourceManager.remove(requestId);

		if (result != null) {
			// sanity check
			assert !pendingRequests.containsKeyA(requestId) : "A pending requests should only be part of either " +
				"the pendingRequests or waitingForResourceManager but not both.";

			return result;
		} else {
			return pendingRequests.removeKeyA(requestId);
		}
	}
842067
public Object remove(int index) {
        return index >= 0 && index < this.length()
            ? this.myArrayList.remove(index)
            : null;
    }
997046
public QueueElement deQueue()
    {
        if (pHead == null)
            return null;

        QueueElement pRet = pHead;
        pHead = pHead.next;

        return pRet;
    }