next up previous contents
Next: Message Correlator Up: Structural Patterns Previous: Example

   
Synchronous Group Message Call (SyncCall)

A synchronous call object sends an asynchronous message to a group and waits for the first, the first N, or all responses. The caller is blocked until response(s) is/are returned.

SyncCall objects are intended to be used on objects that implement the Transportable interface. They allow to emulate synchronous message exchange on top of an asynchronous message transport, that is the sending of a message to a group (or a single member) and the reception of the result in one step. When sending messages to a group, there might be none, one or more responses. The SyncCall interface allows to specify how many responses should be returned (one, none, n, or all). Additionally, a timeout defines the maximum amount of time to wait for the arrival of a message.

To implement a synchronous message call, SyncCall is given an object that implements interface Transportable (e.g. a channel). This interface contains a Send and a Receive method, which allows SyncCall to send a request and wait for the corresponding response(s).

SyncCall does not use the MessageCorrelator class, but instead implements a simple(r) and less sophisticated message correlation scheme.

Other patterns such as RemoteMethodCall (2.2.8) make use of SyncCall.


next up previous contents
Next: Message Correlator Up: Structural Patterns Previous: Example
Bela Ban
1998-08-06