next up previous contents
Next: Creating a channel Up: Using JavaGroups Previous: MembershipListener

   
Channels

Channels are the means by which member processes in a group can communicate with each other: they are used to send and receive messages and views. A channel represents a single member process; at any point only a single process can be connected to a channel. When a client connects to a channel, it indicates the group address (usually the name of the group) it would like to join. Thus, a channel is (in its connected state) always associated with a particular group. The group membership protocol (GMS, see 3.5.3 and 7.2.5) takes care that channels with the same group name find each other: whenever a client connects to a channel given group name G, then the GMS tries to find existing channels with the same name, and joins them, resulting in a new view being installed (which contains the new member).

A state transition diagram for the major states a channel can assume are shown in fig. 3.2.


  
Figure 3.2: Channel states
\begin{figure}
\center{\epsfig{file=/home/bba/JavaGroups/Papers/UsersGuide/figs/ChannelStates.eps,width=.4\textwidth} }
\end{figure}

When a channel is first created, it is in the unconnected state. An attempt to perform certain operations which are only valid in the connected state (e.g. send/receive messages) will result in an exception. After a successful connection by a client, it moves to the connected state. Now channels will receives messages, views and suspicions from other members and may send messages to other members or to the group. Getting the local address of a channel is guaranteed to be a valid operation in this state (see below). When the channel is disconnected, it moves back to the unconnected state. Both a connected and unconnected channel may be closed, which makes the channel unusable for further operations. Any attempt to do so will result in an exception. When a channel is closed directly from a connected state, it will first be disconnected, and then closed.

The methods available for creating and manipulating channels are discussed below.



 
next up previous contents
Next: Creating a channel Up: Using JavaGroups Previous: MembershipListener

1999-08-19