Package org.jgroups.util
Class FIFOMessageQueue<K,V>
- java.lang.Object
-
- org.jgroups.util.FIFOMessageQueue<K,V>
-
public class FIFOMessageQueue<K,V> extends java.lang.Object
Blocking queue which can only process 1 message per service concurrently, establishing FIFO order per sender. Example: if message A1, A2, A3, B1, B2 (where A and B are service names for services on top of a Multiplexer) arrive at the same time, then this class will deliver A1 and B1 concurrently (ie. pass them up to the thread pool for processing). Only when A1 is done will A2 be processed, same for B2: it will get processed when B1 is done. Thus, messages for different services are processed concurrently; messages from the same service are processed FIFO.- Version:
- $Id: FIFOMessageQueue.java,v 1.8 2007/06/29 10:57:40 belaban Exp $
- Author:
- Bela Ban
-
-
Constructor Summary
Constructors Constructor Description FIFOMessageQueue()
-
-
-
Method Detail
-
take
public V take() throws java.lang.InterruptedException
- Throws:
java.lang.InterruptedException
-
poll
public V poll(long timeout) throws java.lang.InterruptedException
- Throws:
java.lang.InterruptedException
-
put
public void put(Address sender, K dest, V el) throws java.lang.InterruptedException
- Throws:
java.lang.InterruptedException
-
size
public int size()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-