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.
-
EnsChannel(String, String)
- Creates a new EnsChannel, which spawns an outboard process and connects to it.
-
EnsChannel(String, String, String, int)
- Creates a new EnsChannel.
-
AcceptedView(Hot_GroupContext, Object, Hot_ViewState)
-
-
Block(Hot_GroupContext, Object)
-
-
Cast(byte[])
- Send to all members
-
Connect(long)
- Start receiving (and storing) msgs
-
Destroy()
- Deletes the channel
-
Disconnect()
- Stop receiving msgs
-
Exit(Hot_GroupContext, Object)
-
-
finalize()
-
-
GetAddress()
-
-
GetMembers()
- Get all members
-
GetName()
-
-
GetNumMembers()
- Get number of members connected to channel including caller
-
Heartbeat(Hot_GroupContext, Object, int)
-
-
Receive(long)
- Receive a message (must be connected)
-
ReceiveCast(Hot_GroupContext, Object, Hot_Endpoint, Hot_Message)
-
-
ReceiveSend(Hot_GroupContext, Object, Hot_Endpoint, Hot_Message)
-
-
Send(Message)
- Send a message
-
Send(Object, byte[])
- Send to 1 member
-
Send(Vector, byte[])
- Fix: send a multicast to the whole group.
-
SetMembershipListener(MembershipListener)
-
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.
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.
finalize
public void finalize()
- Overrides:
- finalize in class Object
Destroy
public void Destroy()
- Deletes the channel
- Overrides:
- Destroy in class Channel
Connect
public void Connect(long timeout) throws Exception
- Start receiving (and storing) msgs
- Overrides:
- Connect in class Channel
Disconnect
public void Disconnect()
- Stop receiving msgs
- Overrides:
- Disconnect in class Channel
Cast
public void Cast(byte msg[]) throws NotConnected
- Send to all members
- Overrides:
- Cast in class Channel
Send
public void Send(Object dest_addr,
byte msg[]) throws NotConnected
- Send to 1 member
- Overrides:
- Send in class Channel
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
Send
public void Send(Message msg) throws NotConnected
- Send a message
- Overrides:
- Send in class Channel
Receive
public Message Receive(long timeout) throws NotConnected, TimeoutException
- Receive a message (must be connected)
- Overrides:
- Receive in class Channel
GetMembers
public Vector GetMembers()
- Get all members
- Overrides:
- GetMembers in class Channel
GetNumMembers
public int GetNumMembers()
- Get number of members connected to channel including caller
- Overrides:
- GetNumMembers in class Channel
GetAddress
public Object GetAddress()
- Overrides:
- GetAddress in class Channel
GetName
public String GetName()
- Overrides:
- GetName in class Channel
SetMembershipListener
public void SetMembershipListener(MembershipListener l)
- Overrides:
- SetMembershipListener in class Channel
ReceiveCast
public void ReceiveCast(Hot_GroupContext gctx,
Object env,
Hot_Endpoint origin,
Hot_Message msg)
ReceiveSend
public void ReceiveSend(Hot_GroupContext gctx,
Object env,
Hot_Endpoint origin,
Hot_Message msg)
AcceptedView
public void AcceptedView(Hot_GroupContext gctx,
Object env,
Hot_ViewState viewState)
Heartbeat
public void Heartbeat(Hot_GroupContext gctx,
Object env,
int rate)
Block
public void Block(Hot_GroupContext gctx,
Object env)
Exit
public void Exit(Hot_GroupContext gctx,
Object env)
All Packages Class Hierarchy This Package Previous Next Index