|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.echomine.jabber.MessageRequestQueue
public class MessageRequestQueue
this class stores messages that are to be sent out. If the message is waiting for a reply message, it will put it into the outstanding queue. Everything is synchronized for multithreading safety. The queue must be "start()ed" first and shutdown() afterwards.
Constructor Summary | |
---|---|
MessageRequestQueue()
|
Method Summary | |
---|---|
void |
addMessage(JabberMessage msg)
adds a message to send to the end of the queue |
void |
clear()
clear all the messages in the queues |
JabberMessage |
getMessageForReply(java.lang.String id)
checks if the there is an outstanding message waiting for a reply. |
void |
shutdown()
wake up all the waiting threads possibly because someone is doing some shutdown work |
void |
start()
resets all states back to the default |
JabberMessage |
waitForMessage()
this will go into a wait state, waiting for any incoming messages. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MessageRequestQueue()
Method Detail |
---|
public void addMessage(JabberMessage msg)
public JabberMessage waitForMessage()
public void shutdown()
public JabberMessage getMessageForReply(java.lang.String id)
id
- the unique ID of the message
public void clear()
public void start()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |