public interface IMessageEndpoint
Modifier and Type | Method and Description |
---|---|
void |
addNewMessageListener(NewMessageListener listener)
Adds a handler for an event that occurs when a new message arrives.
|
java.util.UUID |
getId()
Gets the id of the participant's mailbox.
|
void |
postMessage(java.lang.Object message,
java.util.UUID target)
Posts a message to the specified target mailbox.
|
void |
postMessage(java.lang.Object message,
java.util.UUID target,
boolean quietlyFail)
Posts a message to the specified target mailbox.
|
java.lang.Object |
receiveMessage()
Receives a message from the participant's mailbox.
|
java.lang.Object |
receiveMessage(int millisecondsTimeout)
Receives a message from the participant's mailbox.
|
java.lang.Object |
receiveMessage(int millisecondsTimeout,
java.util.UUID[] sender)
Receives a message from the participant's mailbox.
|
java.lang.Object |
receiveMessage(java.util.UUID[] sender)
Receives a message from the participant's mailbox.
|
void addNewMessageListener(NewMessageListener listener)
java.util.UUID getId()
void postMessage(java.lang.Object message, java.util.UUID target)
message
- The message.target
- The target.JobSchedulerException
- If target mailbox does not exist.void postMessage(java.lang.Object message, java.util.UUID target, boolean quietlyFail)
message
- The message.target
- The target.quietlyFail
- If true
will not throw an exception if target does
not exist.JobSchedulerException
- If target mailbox does not exist.java.lang.Object receiveMessage()
JobSchedulerException
- If target mailbox does not exist.java.lang.Object receiveMessage(java.util.UUID[] sender)
sender
- The address of the sender of the message.java.lang.Object receiveMessage(int millisecondsTimeout)
millisecondsTimeout
- The number of milliseconds to wait, or -1 to wait indefinitely.null
if timeout is elapsed.java.lang.Object receiveMessage(int millisecondsTimeout, java.util.UUID[] sender)
millisecondsTimeout
- The number of milliseconds to wait, or -1 to wait indefinitely.sender
- The address of the sender of the message.null
if timeout is elapsed.