Interface Channel

All Known Subinterfaces:
ManagedChannel
All Known Implementing Classes:
GroupChannel

public interface Channel
Channel interface
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:
1. send messages
2. receive message (by registering a ChannelListener
3. get all members of the group getMembers()
4. receive notifications of members added and members disappeared by registering a MembershipListener

The channel has 5 major components:
1. Data receiver, with a built in thread pool to receive messages from other peers
2. Data sender, an implementation for sending data using NIO or java.io
3. Membership listener,listens for membership broadcasts
4. Membership broadcaster, broadcasts membership pings.
5. 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: