org.apache.catalina.tribes |
Apache Tribes - The Tomcat Cluster Communication Module
QuickStart
//create a channel
Channel myChannel = new GroupChannel();
//create my listeners
MyMessageListener msgListener = new MyMessageListener();
MyMemberListener mbrListener = new MyMemberListener();
//attach the listeners to the channel
myChannel.addMembershipListener(mbrListener);
myChannel.addChannelListener(msgListener);
//start the channel
myChannel.start(Channel.DEFAULT);
//create a message to be sent, message must implement java.io.Serializable
//for performance reasons you probably want them to implement java.io.Externalizable
Serializable myMsg = new MyMessage();
//retrieve my current members
Member[] group = myChannel.getMembers();
//send the message
channel.send(group,myMsg,Channel.SEND_OPTIONS_DEFAULT);
Interfaces for the Application Developer
org.apache.catalina.tribes.Channel
Main component to interact with to send messages
org.apache.catalina.tribes.MembershipListener
Listen to membership changes
org.apache.catalina.tribes.ChannelListener
Listen to data messages
org.apache.catalina.tribes.Member
Identifies a node, implementation specific, default is org.apache.catalina.tribes.membership.MemberImpl
Interfaces for the Tribes Component Developer
org.apache.catalina.tribes.Channel
Main component to that the application interacts with
org.apache.catalina.tribes.ChannelReceiver
IO Component to receive messages over some network transport
org.apache.catalina.tribes.ChannelSender
IO Component to send messages over some network transport
org.apache.catalina.tribes.MembershipService
IO Component that handles membership discovery and
org.apache.catalina.tribes.ChannelInterceptor
interceptors between the Channel and the IO layer
org.apache.catalina.tribes.ChannelMessage
The message that is sent through the interceptor stack down to the IO layer
org.apache.catalina.tribes.Member
Identifies a node, implementation specific to the underlying IO logic
|
Java Source File Name | Type | Comment |
ByteMessage.java | Class | A byte message is not serialized and deserialized by the channel
instead it is sent as a byte array
By default Tribes uses java serialization when it receives an object
to be sent over the wire. |
Channel.java | Interface | 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. |
ChannelException.java | Class | Channel Exception
A channel exception is thrown when an internal error happens
somewhere in the channel. |
ChannelInterceptor.java | Interface | A ChannelInterceptor is an interceptor that intercepts
messages and membership messages in the channel stack.
This allows interceptors to modify the message or perform
other actions when a message is sent or received.
Interceptors are tied together in a linked list.
See Also: org.apache.catalina.tribes.group.ChannelInterceptorBase author: Filip Hanik version: $Revision: 467222 $, $Date: 2006-10-24 05:17:11 +0200 (mar., 24 oct. |
ChannelListener.java | Interface | Title: ChannelListener
Description: An interface to listens to incoming messages from a channel
When a message is received, the Channel will invoke the channel listener in a conditional sequence.
if ( listener.accept(msg,sender) ) listener.messageReceived(msg,sender);
A ChannelListener implementation MUST NOT return true on accept(Serializable, Member)
if it doesn't intend to process the message. |
ChannelMessage.java | Interface | |
ChannelReceiver.java | Interface | ChannelReceiver Interface
The ChannelReceiver interface is the data receiver component
at the bottom layer, the IO layer (for layers see the javadoc for the
Channel interface).
This class may optionally implement a thread pool for parallel processing of incoming messages.
author: Filip Hanik version: $Revision: 467222 $, $Date: 2006-10-24 05:17:11 +0200 (mar., 24 oct. |
ChannelSender.java | Interface | ChannelReceiver Interface
The ChannelSender interface is the data sender component
at the bottom layer, the IO layer (for layers see the javadoc for the
Channel interface).
The channel sender must support "silent" members, ie, be able to send a message to a member
that is not in the membership, but is part of the destination parameter
author: Filip Hanik version: $Revision: 467222 $, $Date: 2006-10-24 05:17:11 +0200 (mar., 24 oct. |
Constants.java | Class | Manifest constants for the org.apache.catalina.tribes
package.
author: Bip Thelin author: Filip Hanik version: $Revision: 467222 $, $Date: 2006-10-24 05:17:11 +0200 (mar., 24 oct. |
ErrorHandler.java | Interface | The ErrorHandler class is used when sending messages
that are sent asynchronously and the application still needs to get
confirmation when the message was sent successfully or when a message errored out. |
Heartbeat.java | Interface | |
ManagedChannel.java | Interface | Channel interface
A managed channel interface gives you access to the components of the channels
such as senders, receivers, interceptors etc for configurations purposes
author: Filip Hanik version: $Revision: 467222 $, $Date: 2006-10-24 05:17:11 +0200 (mar., 24 oct. |
Member.java | Interface | The Member interface, defines a member in the group.
Each member can carry a set of properties, defined by the actual implementation.
A member is identified by the host/ip/uniqueId
The host is what interface the member is listening to, to receive data
The port is what port the member is listening to, to receive data
The uniqueId defines the session id for the member. |
MembershipListener.java | Interface | The MembershipListener interface is used as a callback to the
membership service. |
MembershipService.java | Interface | MembershipService Interface
The MembershipService interface is the membership component
at the bottom layer, the IO layer (for layers see the javadoc for the
Channel interface).
author: Filip Hanik version: $Revision: 467222 $, $Date: 2006-10-24 05:17:11 +0200 (mar., 24 oct. |
MessageListener.java | Interface | |
RemoteProcessException.java | Class | Title: RemoteProcessException
Description: Message thrown by a sender when USE_SYNC_ACK receives a FAIL_ACK_COMMAND.
This means that the message was received on the remote node but the processing of the message failed. |
UniqueId.java | Class | |