Logo Search packages:      
Sourcecode: libjgroups-java version File versions

org::jgroups::Channel Class Reference

Inheritance diagram for org::jgroups::Channel:

org::jgroups::Transport org::jgroups::JChannel org::jgroups::mux::MuxChannel

List of all members.


Detailed Description

A channel represents a group communication endpoint (like BSD datagram sockets). A client joins a group by connecting the channel to a group address and leaves it by disconnecting. Messages sent over the channel are received by all group members that are connected to the same group (that is, all members that have the same group address).

The FSM for a channel is roughly as follows: a channel is created (unconnected). The channel is connected to a group (connected). Messages can now be sent and received. The channel is disconnected from the group (unconnected). The channel could now be connected to a different group again. The channel is closed (closed).

Only a single sender is allowed to be connected to a channel at a time, but there can be more than one channel in an application.

Messages can be sent to the group members using the send method and messages can be received using receive (pull approach).

A channel instance is created using either a ChannelFactory or the public constructor. Each implementation of a channel must provide a subclass of Channel and an implementation of ChannelFactory.

Various degrees of sophistication in message exchange can be achieved using building blocks on top of channels; e.g., light-weight groups, synchronous message invocation, or remote method calls. Channels are on the same abstraction level as sockets, and should really be simple to use. Higher-level abstractions are all built on top of channels.

Author:
Bela Ban
See also:
java.net.DatagramPacket

java.net.MulticastSocket

Definition at line 45 of file Channel.java.


Public Member Functions

synchronized void addChannelListener (ChannelListener listener)
abstract void blockOk ()
synchronized void clearChannelListeners ()
abstract void close ()
abstract void connect (String cluster_name, Address target, String state_id, long timeout) throws ChannelException
abstract void connect (String cluster_name) throws ChannelException
abstract void disconnect ()
void down (Event evt)
Object downcall (Event evt)
String dumpQueue ()
abstract Map dumpStats ()
abstract boolean flushSupported ()
abstract boolean getAllStates (Vector targets, long timeout) throws ChannelNotConnectedException, ChannelClosedException
abstract String getChannelName ()
abstract String getClusterName ()
abstract Map< String, Object > getInfo ()
abstract Address getLocalAddress ()
int getNumMessages ()
abstract Object getOpt (int option)
abstract boolean getState (Address target, String state_id, long timeout) throws ChannelNotConnectedException, ChannelClosedException
abstract boolean getState (Address target, long timeout) throws ChannelNotConnectedException, ChannelClosedException
abstract View getView ()
abstract boolean isConnected ()
abstract boolean isOpen ()
void open () throws ChannelException
abstract Object peek (long timeout) throws ChannelNotConnectedException, ChannelClosedException, TimeoutException
abstract Object receive (long timeout) throws ChannelNotConnectedException, ChannelClosedException, TimeoutException
synchronized void removeChannelListener (ChannelListener listener)
abstract void returnState (byte[] state, String state_id)
abstract void returnState (byte[] state)
abstract void send (Address dst, Address src, Serializable obj) throws ChannelNotConnectedException, ChannelClosedException
abstract void send (Message msg) throws ChannelNotConnectedException, ChannelClosedException
void setChannelListener (ChannelListener channel_listener)
abstract void setInfo (String key, Object value)
abstract void setOpt (int option, Object value)
void setReceiver (Receiver r)
void setUpHandler (UpHandler up_handler)
abstract void shutdown ()
abstract boolean startFlush (long timeout, boolean automatic_resume)
abstract boolean startFlush (boolean automatic_resume)
abstract boolean startFlush (List< Address > flushParticipants, boolean automatic_resume)
abstract void stopFlush (List< Address > flushParticipants)
abstract void stopFlush ()

Static Public Member Functions

static String option2String (int option)

Static Public Attributes

static final int AUTO_GETSTATE = 6
static final int AUTO_RECONNECT = 5
static final int BLOCK = 0
static final int GET_STATE_EVENTS = 4
static final int LOCAL = 3
static final int SUSPECT = 2
static final int VIEW = 1

Protected Member Functions

abstract Log getLog ()
void notifyChannelClosed (Channel c)
void notifyChannelConnected (Channel c)
void notifyChannelDisconnected (Channel c)
void notifyChannelReconnected (Address addr)
void notifyChannelShunned ()

Protected Attributes

Set< ChannelListenerchannel_listeners = null
Receiver receiver = null
UpHandler up_handler = null

The documentation for this class was generated from the following file:

Generated by  Doxygen 1.6.0   Back to index