|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.rit.m2mp.MessageQueue
public class MessageQueue
Class MessageQueue provides a FIFO queue of incoming M2MP messages (type
MessageInputStream
).
Note: Class MessageQueue is multiple thread safe.
Constructor Summary | |
---|---|
MessageQueue()
Construct a new message queue. |
Method Summary | |
---|---|
MessageInputStream |
get()
Get a message from the beginning of this message queue. |
MessageInputStream |
get(long timeout)
Get a message from the beginning of this message queue, with a timeout. |
void |
put(MessageInputStream theMessage)
Put the given message at the end of this message queue. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MessageQueue()
Method Detail |
---|
public void put(MessageInputStream theMessage)
theMessage
- Message.public MessageInputStream get() throws InterruptedException
InterruptedException
- Thrown if the calling thread was interrupted while blocked in this
method.public MessageInputStream get(long timeout) throws InterruptedException
timeout
- Timeout interval (milliseconds), or 0 for a non-blocking
call.
IllegalArgumentException
- (unchecked exception) Thrown if timeout < 0.
InterruptedException
- Thrown if the calling thread was interrupted while blocked in this
method.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |