Class Queue


  • @Deprecated(forRemoval=true)
    public class Queue
    extends Object
    Deprecated, for removal: This API element is subject to removal in a future version.
    RMI support is deprecated and will be removed in a future version of Jackrabbit; see Jira ticket JCR-4972 for more information.

    The Queue class is a very simple queue assuming that there is at least one consumer and potentially multiple producers. This class poses no restrictions on the size of the queue.

    • Constructor Summary

      Constructors 
      Constructor Description
      Queue()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Creates an instance of this queue.
    • Constructor Detail

      • Queue

        public Queue()
        Deprecated, for removal: This API element is subject to removal in a future version.
        Creates an instance of this queue.
    • Method Detail

      • put

        public void put​(Object object)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Appends the given object to the end of the queue.

        After appending the element, the queue is notified such that threads waiting to retrieve an element from the queue are woken up.

        Parameters:
        object - the object to be added
      • get

        public Object get​(long timeout)
                   throws InterruptedException
        Deprecated, for removal: This API element is subject to removal in a future version.
        Returns the first element from the queue. If the queue is currently empty the method waits at most the given number of milliseconds.
        Parameters:
        timeout - The maximum number of milliseconds to wait for an entry in the queue if the queue is empty. If zero, the method waits forever for an element.
        Returns:
        The first element of the queue or null if the method timed out waiting for an entry.
        Throws:
        InterruptedException - Is thrown if the current thread is interrupted while waiting for the queue to get at least one entry.