Interface Channel

All Known Subinterfaces:
ManagedChannel
All Known Implementing Classes:
GroupChannel

public interface Channel
A channel is a representation of a group of nodes all participating in some sort of communication with each other.

The channel is the main API class for Tribes, this is essentially the only class that an application needs to be aware of. Through the channel the application can:

  • send messages
  • receive message (by registering a ChannelListener
  • get all members of the group getMembers()
  • receive notifications of members added and members disappeared by registering a MembershipListener
The channel has 5 major components:
  • Data receiver, with a built in thread pool to receive messages from other peers
  • Data sender, an implementation for sending data using NIO or java.io
  • Membership listener,listens for membership broadcasts
  • Membership broadcaster, broadcasts membership pings.
  • Channel interceptors, the ability to manipulate messages as they are sent or arrive
The channel layout is:
 
  ChannelListener_1..ChannelListener_N MembershipListener_1..MembershipListener_N [Application Layer]
            \          \                  /                   /
             \          \                /                   /
              \          \              /                   /
               \          \            /                   /
                \          \          /                   /
                 \          \        /                   /
                  ---------------------------------------
                                  |
                                  |
                               Channel
                                  |
                         ChannelInterceptor_1
                                  |                                               [Channel stack]
                         ChannelInterceptor_N
                                  |
                             Coordinator (implements MessageListener,MembershipListener,ChannelInterceptor)
                          --------------------
                         /        |           \
                        /         |            \
                       /          |             \
                      /           |              \
                     /            |               \
           MembershipService ChannelSender ChannelReceiver                        [IO layer]
 
 
See Also: