All Packages Class Hierarchy This Package Previous Next Index
Class JavaGroups.JChannel
java.lang.Object
|
+----JavaGroups.Channel
|
+----JavaGroups.JChannel
- public class JChannel
- extends Channel
JChannel is a pure Java implementation of Channel.
-
JChannel(String, String)
-
-
Cast(byte[])
- Send to all members
-
Connect(long)
- Start receiving (and storing) msgs
-
Destroy()
- Deletes the channel
-
Disconnect()
- Stop receiving msgs
-
Down(Event)
-
-
finalize()
-
-
GetAddress()
-
-
GetMembers()
- Get all members
-
GetName()
-
-
GetNumMembers()
- Get number of members connected to channel including caller
-
Receive(long)
- Receive a message (must be connected)
-
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)
-
-
Up(Event)
- Called by the ProtocolStack when a message is received.
JChannel
public JChannel(String name,
String properties)
finalize
public void finalize()
- Overrides:
- finalize in class Object
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
Destroy
public void Destroy()
- Deletes the channel
- Overrides:
- Destroy in class Channel
Cast
public void Cast(byte msg[]) throws Exception
- Send to all members
- Overrides:
- Cast in class Channel
Send
public void Send(Object dest_addr,
byte msg[]) throws Exception
- 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 Exception
- 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
SetMembershipListener
public void SetMembershipListener(MembershipListener listener)
- Overrides:
- SetMembershipListener in class Channel
GetAddress
public Object GetAddress()
- Overrides:
- GetAddress in class Channel
GetName
public String GetName()
- Overrides:
- GetName in class Channel
Up
public void Up(Event evt)
- Called by the ProtocolStack when a message is received. It will be added to the message
queue from which subsequent
Receive
s will dequeue it.
Down
public void Down(Event evt)
All Packages Class Hierarchy This Package Previous Next Index