next up previous contents
Next: Class Protocol Up: The JChannel protocol stack Previous: Events and messages

Architecture

The architecture of the protocol stack is shown in fig. 4.1.


  
Figure 4.1: Architecture of the JChannel protocol stack
\begin{figure}
\center{\epsfig{file=/home/bba/JavaGroups/Papers/UsersGuide/figs/ProtStackArchitecture.eps,width=.6\textwidth} }
\end{figure}

A JChannel is connected to a JavaGroups.JavaStack.ProtocolStack object which manages the protocol stack. The latter uses a configurator ( JavaGroups.JavaStack.Configurator, see 4.1.5) to create and configure a protocol stack, and essentially functions as an adapter between the topmost protocol and the JChannel. Whenever ProtocolStack receives a message from above, the message is passed on to the topmost protocol layer, and when it receives a message, it is passed up to the JChannel. When a JChannel is created, it will create an instance of ProtocolStack and use it to manage the stack on its behalf. When an application connects to the channel, the protocol stack will be started, and when it disconnects the stack will be stopped4.4. When the channel is closed, the stack will be destroyed, releasing its resources. To do this, ProtocolStack again uses the help of Configurator.

Protocol layers are connected through bidirectional FIFO queues. Each protocol has 2 queues: one for storing incoming messages (traveling up the stack) and one for outgoing messages (traveling downwards). Each queue is handled by a separate thread: its only function is to remove 1 message from the queue (it will block until a message is added to the queue) and pass it up/down to the next layer by invoking Up or Down respectively. The next layer will then store it in its incoming or outgoing queue. If a message traveling down is received by the bottommost layer, it will be put on the network. If a message traveling up is received by the topmost layer, it is passed on to the ProtocolStack, which forwards it to the JChannel. JChannel stores all messages received by the protocol stack in a queue, where it can be removed by an application calling JChannel.Receive (or by a PullPushAdapter, see 3.4.1). Messages sent by the JChannel are just passed on to the protocol stack, which in turn forwards it to its topmost protocol layer.


next up previous contents
Next: Class Protocol Up: The JChannel protocol stack Previous: Events and messages

1999-08-19