mcgui
Class Multicaster

java.lang.Object
  extended by mcgui.Multicaster

public abstract class Multicaster
extends java.lang.Object

Class to extend when creating a multicast module


Field Summary
protected  BasicCommunicator bcom
          The communication backend.
protected  int hosts
          Initial number of hosts in network.
protected  int id
          Id of the client.
protected  MulticasterUI mcui
          The user interface.
 
Constructor Summary
Multicaster()
           
 
Method Summary
abstract  void basicpeerdown(int peer)
          Signals that a peer is down and has been down for a while to allow for messages taking different paths from this peer to arrive.
abstract  void basicreceive(int peer, Message message)
          Receive a basic message
abstract  void cast(java.lang.String messagetext)
          Multicast a message
 void enableUI()
          Enables the user to start using the system.
 int getId()
          Returns id of the client.
abstract  void init()
          Method for initialization of things.
 void setCommunicator(BasicCommunicator bcom)
          Set BasicCommunicator that should be used
 void setId(int id, int hosts)
          Set the id of the client
 void setUI(MulticasterUI mcui)
          Set the UI that should be used
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

id

protected int id
Id of the client.


hosts

protected int hosts
Initial number of hosts in network.


mcui

protected MulticasterUI mcui
The user interface.


bcom

protected BasicCommunicator bcom
The communication backend.

Constructor Detail

Multicaster

public Multicaster()
Method Detail

getId

public int getId()
Returns id of the client.


init

public abstract void init()
Method for initialization of things.


cast

public abstract void cast(java.lang.String messagetext)
Multicast a message

Parameters:
message - The message to be multicasted

basicreceive

public abstract void basicreceive(int peer,
                                  Message message)
Receive a basic message

Parameters:
message - The message received

basicpeerdown

public abstract void basicpeerdown(int peer)
Signals that a peer is down and has been down for a while to allow for messages taking different paths from this peer to arrive.

Parameters:
peer - The dead peer

setId

public void setId(int id,
                  int hosts)
Set the id of the client

Parameters:
id - The id

setUI

public void setUI(MulticasterUI mcui)
Set the UI that should be used

Parameters:
mcui - The UI

setCommunicator

public void setCommunicator(BasicCommunicator bcom)
Set BasicCommunicator that should be used

Parameters:
bcom - The Basic communicator

enableUI

public void enableUI()
Enables the user to start using the system.