|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
interface MessageQueue
Interface MessageQueue
represents a First-In-First-Out (FIFO)
persistent list of Message (source and target agent identifier,
notification).
Method Summary | |
---|---|
Message |
get()
Looks at the message at the top of this queue without removing it from the queue. |
Message |
get(long timeout)
Looks at the message at the top of this queue without removing it from the queue. |
void |
insert(Message item)
Insert a message in the queue, it should only be used during initialization for restoring the queue state. |
Message |
pop()
Removes the message at the top of this queue. |
void |
push(Message item)
Pushes a message onto the bottom of this queue. |
int |
size()
Returns the number of messages in this MessageQueue
object. |
void |
validate()
Atomically validates all messages pushed in queue during a reaction. |
Method Detail |
---|
void insert(Message item)
item
- the message to be pushed onto this queue.void push(Message item)
item
- the message to be pushed onto this queue.Message pop() throws EmptyQueueException
EmptyQueueException
- if this queue is empty.void validate()
Message get() throws java.lang.InterruptedException
java.lang.InterruptedException
- if another thread has interrupted the
current thread.Message get(long timeout) throws java.lang.InterruptedException
timeout
- the maximum time to wait in milliseconds.
java.lang.InterruptedException
- if another thread has interrupted the
current thread.
java.lang.IllegalArgumentException
- if the value of timeout is negative.int size()
MessageQueue
object. Be careful, the result includes messages to be validated.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |