Interface AsyncEndpoint<M>
-
- Type Parameters:
M
-
- All Known Implementing Classes:
AsyncEndpointAdapter
,AxisAsyncEndpoint
,JettyAsyncEndpoint
,JettyByteArrayAsyncEndpoint
,JettyRESTAsyncEndpoint
public interface AsyncEndpoint<M>
Interface implemented by in-only test endpoints.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 callwaitForMessage(int)
.There are two strategies to guarantee this behavior:
- The underlying transport internally queues incoming messages.
In that case
waitForMessage(int)
should simply poll for new messages. An example of this type of transport is the mail transport. - The underlying transport requires that incoming messages are
processed immediately. In that case the implementation should
set up the required receiver or message processor and add
incoming messages to an internal queue that is polled
when
waitForMessage(int)
is called. An example of this kind of transport is HTTP. Implementations can useInOnlyEndpointSupport
to manage the message queue.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
clear()
Discard any pending messages.IncomingMessage<M>
waitForMessage(int timeout)
-