TMessage
- Type of the message.public class MessageQueue<TMessage>
extends java.lang.Object
Constructor and Description |
---|
MessageQueue() |
Modifier and Type | Method and Description |
---|---|
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.
|
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()