public interface Messenger
Modifier and Type | Method and Description |
---|---|
Message |
receive()
Returns a message received by the gateway.
|
Message |
receive(java.lang.Class<?> cls)
Returns a message of a given class received by the gateway.
|
Message |
receive(java.lang.Class<?> cls,
long timeout)
Returns a message of a given class received by the gateway.
|
Message |
receive(long timeout)
Returns a message received by the agent.
|
Message |
receive(Message m)
Returns a response message received by the gateway.
|
Message |
receive(MessageFilter filter)
Returns a message received by the gateway and matching the given filter.
|
Message |
receive(MessageFilter filter,
long timeout)
Returns a message received by the gateway and matching the given filter.
|
Message |
receive(Message m,
long timeout)
Returns a response message received by the gateway.
|
Message |
request(Message msg)
Sends a request and waits for a response.
|
Message |
request(Message msg,
long timeout)
Sends a request and waits for a response.
|
boolean |
send(Message m)
Sends a message to the recipient indicated in the message.
|
boolean send(Message m)
m
- message to be sent.Message receive()
Message receive(long timeout)
timeout
- timeout in milliseconds.Message receive(java.lang.Class<?> cls)
cls
- the class of the message of interest.Message receive(java.lang.Class<?> cls, long timeout)
cls
- the class of the message of interest.timeout
- timeout in milliseconds.Message receive(Message m)
m
- original message to which a response is expected.Message receive(Message m, long timeout)
m
- original message to which a response is expected.timeout
- timeout in milliseconds.Message receive(MessageFilter filter)
filter
- message filter.Message receive(MessageFilter filter, long timeout)
filter
- message filter.timeout
- timeout in milliseconds.Message request(Message msg, long timeout)
msg
- message to send.timeout
- timeout in milliseconds.