JavaGroups is a group communication toolkit written in Java providing reliable multicast communication. Its first version uses the group communication protocols provided by the Ensemble [Hay98] distributed communication toolkit, but future versions will have their own built-in group communication protocols.
Group communication allows communication endpoints to form a group. Messages sent to a group are received by all members of that group. New members may join a group (and subsequently receive all messages sent to the group), and current members may leave a group at any time. Members that have crashed will eventually be removed from a group.
Communication endpoints can be processes or objects, essentially any entity that can send and receive messages to/from a group.
At the core of JavaGroups is a low-level abstraction of a communication endpoint of a group - a channel. When a channel is created it is given a name. Multiple channels with the same name form a group. A new channel automatically joins the group under the given name, and leaves it when it is destroyed. Groups only exist conceptually and can be referred to by their name. Channels are used to represent a member of a group.
Channels can be used to send messages to single members, a subset of the members, or all members. When a channel receives a message, it is stored until a client dequeues it from the channel. In order to be able to send and receive messages, a client must first connect to the channel. Only one client can be connected to a channel at any time. Other clients can only connect to the channel when the previously connected client disconnects from the channel.1.1
Channels are the lowest-level abstraction provided by JavaGroups to create group communication aware applications. Since they are conceptually similar to sockets, their use should be straight-forward to programmers familiar with sockets. However, like sockets, channels provide only a relatively low-level abstraction for asynchronously sending and receiving messages. Any task more complex, like for example synchronous message exchange, RPC-like communication, correlation of request with response(s), or remote method invocation, has to be written by the programmer. One of JavaGroups' goals is to provide small pre-fabricated building blocks (group communication patterns) that perform exactly these tasks, on top of the channel, allowing programmers to access group communication at a higher level of abstraction. These building blocks should be (a) sufficiently small, so that they can be used independently, and (b) they should be able to be combined to create larger building blocks.
A channel is an abstract class and needs to be specialized to provide real group communication facilities. In the current version, a subclass (EnsChannel) is provided that accesses Ensemble to do this. A future version will contain a native Java implementation of Ensemble's group communication protocols (e.g. JChannel).