|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Messenger
Messenger defines a high level interface for sending and receiving messages. Every Messenger contains a single logical queue of incoming messages and a single logical queue of outgoing messages. These messages in these queues may be destined for, or originate from, a variety of addresses.
| Field Summary | |
|---|---|
static int |
CUMULATIVE
Flag for use with reject(), accept() and settle() methods. |
| Method Summary | |
|---|---|
void |
accept(Tracker tracker,
int flags)
Accepts messages retrieved from the incoming message queue. |
Message |
get()
Returns the message from the head of the incoming message queue. |
int |
getIncomingWindow()
|
int |
getOutgoingWindow()
|
Status |
getStatus(Tracker tracker)
Gets the last known remote state of the delivery associated with the given tracker. |
long |
getTimeout()
|
int |
incoming()
Returns a count of the messages available on the incoming queue. |
Tracker |
incomingTracker()
Returns a token which can be used to accept or reject the message returned in the previous get() call. |
void |
interrupt()
|
boolean |
isBlocking()
|
int |
outgoing()
Returns a count of the messages currently on the outgoing queue (i.e. |
Tracker |
outgoingTracker()
Returns a token which can be used to track the status of the message of the previous put() call. |
void |
put(Message message)
Places the content contained in the message onto the outgoing queue of the Messenger. |
void |
recv()
Receives an arbitrary number of messages into the incoming queue of the Messenger. |
void |
recv(int count)
Receives up to the specified number of messages into the incoming queue of the Messenger. |
void |
reject(Tracker tracker,
int flags)
Rejects messages retrieved from the incoming message queue. |
void |
send()
Blocks until the outgoing queue is empty and, in the event that an outgoing window has been set, until the messages in that window have been received by the target to which they were sent, or the operation times out. |
void |
send(int n)
|
void |
setBlocking(boolean b)
|
void |
setIncomingWindow(int window)
|
void |
setOutgoingWindow(int window)
|
void |
setTimeout(long timeInMillis)
|
void |
settle(Tracker tracker,
int flags)
|
void |
start()
Transitions the Messenger to an active state. |
void |
stop()
Transitions the Messenger to an inactive state. |
boolean |
stopped()
|
void |
subscribe(String source)
Subscribes the Messenger to messages originating from the specified source. |
boolean |
work(long timeout)
|
| Field Detail |
|---|
static final int CUMULATIVE
| Method Detail |
|---|
void put(Message message)
throws MessengerException
MessengerException
void send()
throws TimeoutException
TimeoutException
void send(int n)
throws TimeoutException
TimeoutException
void subscribe(String source)
throws MessengerException
MessengerException
void recv()
throws TimeoutException
TimeoutException
void recv(int count)
throws TimeoutException
TimeoutExceptionMessage get()
void start()
throws IOException
IOExceptionvoid stop()
boolean stopped()
boolean work(long timeout)
void interrupt()
void setTimeout(long timeInMillis)
long getTimeout()
boolean isBlocking()
void setBlocking(boolean b)
int outgoing()
int incoming()
int getIncomingWindow()
void setIncomingWindow(int window)
int getOutgoingWindow()
void setOutgoingWindow(int window)
Tracker incomingTracker()
Tracker outgoingTracker()
void reject(Tracker tracker,
int flags)
void accept(Tracker tracker,
int flags)
void settle(Tracker tracker,
int flags)
Status getStatus(Tracker tracker)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||