All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class JavaGroups.EnsChannel

java.lang.Object
   |
   +----JavaGroups.Channel
           |
           +----JavaGroups.EnsChannel

public class EnsChannel
extends Channel
implements Hot_Callbacks
EnsChannel is an implementation of Channel based on Ensemble. It maps a process group to a channel. Requirements are the presence of an executable called outboard (which is Ensemble) and gossip running.


Constructor Index

 o EnsChannel(String, String)
Creates a new EnsChannel, which spawns an outboard process and connects to it.
 o EnsChannel(String, String, String, int)
Creates a new EnsChannel.

Method Index

 o AcceptedView(Hot_GroupContext, Object, Hot_ViewState)
 o Block(Hot_GroupContext, Object)
 o Cast(byte[])
Send to all members
 o Connect(long)
Start receiving (and storing) msgs
 o Destroy()
Deletes the channel
 o Disconnect()
Stop receiving msgs
 o Exit(Hot_GroupContext, Object)
 o finalize()
 o GetAddress()
 o GetMembers()
Get all members
 o GetName()
 o GetNumMembers()
Get number of members connected to channel including caller
 o Heartbeat(Hot_GroupContext, Object, int)
 o Receive(long)
Receive a message (must be connected)
 o ReceiveCast(Hot_GroupContext, Object, Hot_Endpoint, Hot_Message)
 o ReceiveSend(Hot_GroupContext, Object, Hot_Endpoint, Hot_Message)
 o Send(Message)
Send a message
 o Send(Object, byte[])
Send to 1 member
 o Send(Vector, byte[])
Fix: send a multicast to the whole group.
 o SetMembershipListener(MembershipListener)

Constructors

 o EnsChannel
 public EnsChannel(String name,
                   String properties)
Creates a new EnsChannel, which spawns an outboard process and connects to it.

Parameters:
name - Channel name. All channels with the same name form a group.
properties - Ensemble properties (cf. Ensemble reference manual). A value of null uses the default properties.
 o EnsChannel
 public EnsChannel(String name,
                   String properties,
                   String transport_props,
                   int outboard_port)
Creates a new EnsChannel. Instead of spawning a new outboard process, it connects to an already running outboard process (on the same machine) using outboard_port. This allows multiple EnsChannels to share a copy of outboard. If the port is 0, outboard will be spawned. Parameter transport_props defines the type of transport to be used (UDP, ATM, IP MCAST etc).

Parameters:
name - Channel name. All channels with the same name form a group.
properties - Ensemble properties (cf. Ensemble reference manual). A value of null uses the default properties.
transport_props - Transport parameters. Null means use default (UDP). Example: "UDP:DEERING" uses IP multicast (gossip is not needed in this case).
outboard_port - Port on which the local outboard process is listening. The outboard process has to be started before. Value of 0 means spawn outboard nevertheless.

Methods

 o finalize
 public void finalize()
Overrides:
finalize in class Object
 o Destroy
 public void Destroy()
Deletes the channel

Overrides:
Destroy in class Channel
 o Connect
 public void Connect(long timeout) throws Exception
Start receiving (and storing) msgs

Overrides:
Connect in class Channel
 o Disconnect
 public void Disconnect()
Stop receiving msgs

Overrides:
Disconnect in class Channel
 o Cast
 public void Cast(byte msg[]) throws NotConnected
Send to all members

Overrides:
Cast in class Channel
 o Send
 public void Send(Object dest_addr,
                  byte msg[]) throws NotConnected
Send to 1 member

Overrides:
Send in class Channel
 o Send
 public void Send(Vector dests,
                  byte msg[]) throws NotConnected
Fix: send a multicast to the whole group. The message sent contains the vector of destination addresses. When a member receives a cast, it checks whether it is member of the destination vector. If not, it discards the message.

This solution is not efficient, but avoids running into message ordering problems when certain members receive a message, and others don't

Overrides:
Send in class Channel
 o Send
 public void Send(Message msg) throws NotConnected
Send a message

Overrides:
Send in class Channel
 o Receive
 public Message Receive(long timeout) throws NotConnected, TimeoutException
Receive a message (must be connected)

Overrides:
Receive in class Channel
 o GetMembers
 public Vector GetMembers()
Get all members

Overrides:
GetMembers in class Channel
 o GetNumMembers
 public int GetNumMembers()
Get number of members connected to channel including caller

Overrides:
GetNumMembers in class Channel
 o GetAddress
 public Object GetAddress()
Overrides:
GetAddress in class Channel
 o GetName
 public String GetName()
Overrides:
GetName in class Channel
 o SetMembershipListener
 public void SetMembershipListener(MembershipListener l)
Overrides:
SetMembershipListener in class Channel
 o ReceiveCast
 public void ReceiveCast(Hot_GroupContext gctx,
                         Object env,
                         Hot_Endpoint origin,
                         Hot_Message msg)
 o ReceiveSend
 public void ReceiveSend(Hot_GroupContext gctx,
                         Object env,
                         Hot_Endpoint origin,
                         Hot_Message msg)
 o AcceptedView
 public void AcceptedView(Hot_GroupContext gctx,
                          Object env,
                          Hot_ViewState viewState)
 o Heartbeat
 public void Heartbeat(Hot_GroupContext gctx,
                       Object env,
                       int rate)
 o Block
 public void Block(Hot_GroupContext gctx,
                   Object env)
 o Exit
 public void Exit(Hot_GroupContext gctx,
                  Object env)

All Packages  Class Hierarchy  This Package  Previous  Next  Index