M
- public interface AsyncEndpoint<M>
The endpoint must be ready to receive messages immediately after it
has been set up. In particular implementations must not make the
assumption that messages are only during a call to waitForMessage(int)
.
Indeed, a typical test case will set up the endpoint, send a message and only
afterwards call waitForMessage(int)
.
There are two strategies to guarantee this behavior:
waitForMessage(int)
should simply poll
for new messages. An example of this type of transport is
the mail transport.waitForMessage(int)
is called. An example of
this kind of transport is HTTP. Implementations can use
InOnlyEndpointSupport
to manage the message queue.Modifier and Type | Method and Description |
---|---|
void |
clear()
Discard any pending messages.
|
IncomingMessage<M> |
waitForMessage(int timeout) |
Copyright © 2004-2015 The Apache Software Foundation. All Rights Reserved.