next up previous contents
Next: The JChannel Protocol Stack Up: Overview Previous: Overview

Building Blocks

Channels are simple and primitive. They offer the bare functionality of group communication, and have on purpose been modeled after BSD sockets. The reason is that an application can make use of just this small subset of JavaGroups, without having to include a whole set of sophisticated classes, that it may not even need. Also, a somewhat minimalistic interface is simple to understand: a client needs to know about 12 methods to be able to create and use a channel (and will use ca. 3-4 methods frequently).

Channels provide asynchronous message sending/reception, somewhat similar to UDP. A message sent is essentially put on the network and the SEND method will return immediately. Conceptual requests, or responses to previous requests, are received in undefined order, and the application has to take care of matching responses with requests. Also, an application has to actively retrieve messages from a channel (pull-style); it is not notified when a message has been received. Note that pull-style message reception often needs another thread of execution, or some form of event-loop, in which a channel is periodically peeked for messages.

JavaGroups offers building blocks that solve these problems. Building blocks make use channels, and are an additional layer between a channel and the application. The latter would now communicate with a building block, instead of directly with the channel. Building blocks are intended to save the application programmer from having to write tedious, recurring code.


next up previous contents
Next: The JChannel Protocol Stack Up: Overview Previous: Overview

1999-12-13