|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecteneter.messaging.dataprocessing.messagequeueing.MessageQueue<TMessage>
TMessage
- Type of the message.public class MessageQueue<TMessage>
Memory message queue. One or more threads can put messages into the queue and other threads can remove them. If the queue is empty the thread reading messages is blocked until a message is put to the queue or the thread is unblocked.
Constructor Summary | |
---|---|
MessageQueue()
|
Method Summary | |
---|---|
void |
blockProcessingThreads()
Sets the queue to the blocking mode. |
TMessage |
dequeueMessage()
Removes the first message from the queue. |
void |
enqueueMessage(TMessage message)
Puts message to the queue. |
int |
getCount()
Returns number of messages in the queue. |
boolean |
isBlockingMode()
Returns true if the queue blocks threads during dequeue and peek. |
TMessage |
peekMessage()
Reads the first message from the queue. |
void |
unblockProcessingThreads()
Releases all threads waiting for messages in DequeueMessage() and sets the queue to the unblocking mode. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MessageQueue()
Method Detail |
---|
public void enqueueMessage(TMessage message)
message
- message that shall be enqueuedpublic TMessage dequeueMessage() throws java.lang.Exception
java.lang.Exception
public TMessage peekMessage() throws java.lang.Exception
java.lang.Exception
public void unblockProcessingThreads()
public void blockProcessingThreads()
public boolean isBlockingMode()
public int getCount()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |