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.


Constructor Index

 o JChannel(String, String)

Method Index

 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 Down(Event)
 o finalize()
 o GetAddress()
 o GetMembers()
Get all members
 o GetName()
 o GetNumMembers()
Get number of members connected to channel including caller
 o Receive(long)
Receive a message (must be connected)
 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)
 o Up(Event)
Called by the ProtocolStack when a message is received.

Constructors

 o JChannel
 public JChannel(String name,
                 String properties)

Methods

 o finalize
 public void finalize()
Overrides:
finalize in class Object
 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 Destroy
 public void Destroy()
Deletes the channel

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

Overrides:
Cast in class Channel
 o Send
 public void Send(Object dest_addr,
                  byte msg[]) throws Exception
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 Exception
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 SetMembershipListener
 public void SetMembershipListener(MembershipListener listener)
Overrides:
SetMembershipListener in class Channel
 o GetAddress
 public Object GetAddress()
Overrides:
GetAddress in class Channel
 o GetName
 public String GetName()
Overrides:
GetName in class Channel
 o 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 Receives will dequeue it.

 o Down
 public void Down(Event evt)

All Packages  Class Hierarchy  This Package  Previous  Next  Index