Class RequestQueue<T>


  • public class RequestQueue<T>
    extends java.lang.Object
    This class describes a authorization request queue, which has a "stuffer" servlet and many "reader" threads. The queue manages thread synchronization so that (a) the "stuffer" servlet blindly appends authority requests, and then waits for these requests to be completed, and (b) the "reader" threads block if queue is empty. The objects being queued are all AuthRequest objects.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String _rcsid  
      protected java.util.List<T> queue  
    • Constructor Summary

      Constructors 
      Constructor Description
      RequestQueue()
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addRequest​(T dd)
      Add a request to the queue.
      T getRequest()
      Pull the next request off the queue, but wait if there is nothing there.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • queue

        protected java.util.List<T> queue
    • Constructor Detail

      • RequestQueue

        public RequestQueue()
        Constructor.
    • Method Detail

      • addRequest

        public void addRequest​(T dd)
        Add a request to the queue.
        Parameters:
        dd - is the request.
      • getRequest

        public T getRequest()
                     throws java.lang.InterruptedException
        Pull the next request off the queue, but wait if there is nothing there.
        Returns:
        the request to be processed.
        Throws:
        java.lang.InterruptedException