public class MessageQueue<T extends ExecutionContext>
extends java.lang.Object
Constructor and Description |
---|
MessageQueue()
Construct a new MessageQueue.
|
MessageQueue(java.util.Collection<RecurringTask<T>> recurringTasks)
Construct a new MessageQueue with the given recurring tasks.
|
Modifier and Type | Method and Description |
---|---|
void |
errorEncountered(java.lang.Throwable throwable)
Indicate than an exception has occurred and store the exception in the queue.
|
java.util.List<java.lang.Throwable> |
getErrorsAndClear()
Get any errors reported to this queue and clear the internal list.
|
java.util.List<Message> |
getIncomingAndClear()
Get all messages that have been received since the last time this method was called, and clear the internal
list.
|
java.util.List<Message> |
getOutgoingAndClear()
Get all messages that have been queued since the last time this method was called, and clear the internal
list.
|
java.util.Collection<RecurringTask<T>> |
getRecurringTasks() |
void |
messageReceived(Message message)
Indicate that a message has been received and add it to the incoming queue.
|
void |
queueOutgoing(Message message)
Queue an outgoing message.
|
public MessageQueue()
public MessageQueue(java.util.Collection<RecurringTask<T>> recurringTasks)
recurringTasks
- The recurring tasks.public void messageReceived(Message message)
message
- The message that has been received.public java.util.List<Message> getIncomingAndClear()
public void queueOutgoing(Message message)
message
- The message to be queued.public java.util.List<Message> getOutgoingAndClear()
public void errorEncountered(java.lang.Throwable throwable)
throwable
- The exception.public java.util.List<java.lang.Throwable> getErrorsAndClear()
public java.util.Collection<RecurringTask<T>> getRecurringTasks()