Class SynchronizedQueue<I extends Item>

  • All Implemented Interfaces:
    Queue<I>

    public class SynchronizedQueue<I extends Item>
    extends Object
    implements Queue<I>
    Version:
    $Revision$
    Author:
    Julien Viet
    • Constructor Detail

      • SynchronizedQueue

        public SynchronizedQueue​(org.exoplatform.services.log.Log log)
    • Method Detail

      • size

        public int size()
        Description copied from interface: Queue
        Returns the queue size
        Specified by:
        size in interface Queue<I extends Item>
        Returns:
        the size
      • assertConsistency

        public void assertConsistency()
      • remove

        public boolean remove​(I item)
        Attempt to remove an item from the queue.
        Specified by:
        remove in interface Queue<I extends Item>
        Parameters:
        item - the item to remove
        Returns:
        true if the item was removed by this thread
      • add

        public void add​(I item)
        Add the item to the head of the list.
        Specified by:
        add in interface Queue<I extends Item>
        Parameters:
        item - the item to add
      • trim

        public ArrayList<I> trim​(int size)
        Attempt to trim the queue. Trim will occur if no other thread is already performing a trim and the queue size is greater than the provided size.
        Specified by:
        trim in interface Queue<I extends Item>
        Parameters:
        size - the wanted size
        Returns:
        the list of evicted items