


Synchronous Group Message Call (async - sync)
---------------------------------------------

Sends an asynchronous message to a group and waits for the first, the
first N, or all responses. Caller is blocked until response(s) is/are
returned.


Channel
-------

A channel represents the group endpoint over which messages can be sent to
all (or a subset) of the group members and over which messages multicast
to group members can be received. It is on purpose designed to be as
simple as possible, similar in semantics to BSD sockets.

Channels use the Half-Sync/Half-Async pattern [2] in that they present a
synchronous interface to the caller (Receive()), but use asynchronous
message reception and message queues to block and awake callers.


MUX
---

Maintains several channels, caller specifies channel over which
messages is to be sent


DEMUX
-----

Receives messages from multiple input channels, combines them into a
single logical channel. Similar to the UNIX SELECT system call. Usually
used in conjunction with Gender Changer.



Gender Changer (Pull - Push Adapter)
--------------------------------------

Bridge (or adapter) between pull-style and push-style of message
delivery. Pull style requires client to actively retrieve messages
from a channel, while push-style takes care of invoking client
callback routine to receive message. Channels use pull-style for
simplicity reasons (recursive calls can be easily handled and client
cannot 'steal' invoker's CPU time, blocking the caller indefinitely).


MethodCall
----------

Allows to specify the name of the method to be called in each group
member and the arguments to the call. Used in conjunction with
synchronous call pattern and Dispatcher.


Dispatcher
----------

Allows objects to register. Receives messages from a channel, invokes
corresponding method in each object registered and returns result as
message. Uses Group and MethodCall.



Group
-----

Is connected to a channel and allows local objects (= objects in the
same address space = JVM) to join the group. All sends are sent to the
channel, all receives are delivered to all objects in the group. Also
called light-weight groups.




Futures / Promise
-----------------

Caller makes a message invocation and is returned a handle (promise)
for a later result. Promise can be checked for result completion,
result status (as in the case of multiple replies). Promise contains
call to return result(s). Allows clients to asynchronously invoking a
method call without having to be blocked until the result is
returned. Suitable for starting multiple invocations in parallel, and
gathering the results later (load balancing).



Message Correlator
------------------

Correlates requests with their responses. Caller can choose to be
returned the first response (in a group call), N responses or all
responses (can also include a timeout to prevent waiting forever).


Failure Detector
----------------

Monitors a group of objects by sending them periodic
heartbeats. Notifies registered entities of suspected objects.


Sets
----

Containers for objects (e.g. addresses or endpoints). Includes methods
for adding, removing members, and intersection / union with other sets.


StableStorage
-------------

Kind of an interceptor that - before passing messages on - stores them on
stable storage. This allows clients that reconnect after a certain time,
to request older messages to be replayed. Coudl be used in conjunction
with PullPushConverter: when no client is connected, whenever a message is
received, it will be stored. When a client connects, all stored messages
are *pushed* to the client and subsequently purged from stable
storage.


LazyPusher
----------

Pushes messages (or method invocations, if used in conjunctions with
MethodCall) to client(s). Used e.g. with PullPushConverter. Rather
than blocking the 'pusher', it enqueues messages and uses its own
thread to push them one after the other to clients. Thus clients can
block the LazyPusher, but never the 'real' pusher. Allows the pusher
to send non time critical notifications to clients without blocking.




References:

[1] Schmidt: Reactor Pattern. UIUC.

[2] Schmidt, Douglas and Charles Cranor. Half-Sync/Half-Async. An
    Architectural Pattern for Efficient and Well-Structured Concurrent I/O

