de.tubs.macs.util.net
Class LRMP

java.lang.Object
  |
  +--de.tubs.macs.util.net.LRMP

public class LRMP
extends java.lang.Object
implements inria.net.lrmp.LrmpEventHandler, Net

LRMP Network System.

This is a reliable multicast system.

There are some limitiations:


Field Summary
static boolean debug
           
static int DEFAULT_BANDWIDTH
           
static int DEFAULT_TTL
           
 
Fields inherited from interface inria.net.lrmp.LrmpEventHandler
END_OF_SEQUENCE, UNRECOVERABLE_SEQUENCE_ERROR
 
Constructor Summary
LRMP(java.lang.String typeID, NetManager netManager)
           
 
Method Summary
 void close()
          close the network
 void flush()
          send all available data
 NetAddress getAddress()
          get the NetAddress of this Net
 java.lang.Object getOptions()
          get the options
 int getTTL()
          return the scope of the Network in form of a TTL.
 java.lang.String getType()
          return the type id of the Network
 void init(NetReceiver receiver, NetAddress netGroup)
          Init the Network.
After calling this method, object can be sent to all instances using the same group and received object from other instances will be forwarded to the NetReceiver.
 void processData(inria.net.lrmp.LrmpPacket packet)
           
 void processEvent(int event, java.lang.Object obj)
           
 void seedHack()
          ugly address hack for applications in a session
 boolean send(java.lang.Object object)
          send an Object to the Network
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

debug

public static final boolean debug

DEFAULT_TTL

public static final int DEFAULT_TTL

DEFAULT_BANDWIDTH

public static final int DEFAULT_BANDWIDTH
Constructor Detail

LRMP

public LRMP(java.lang.String typeID,
            NetManager netManager)
Method Detail

getType

public java.lang.String getType()
Description copied from interface: Net
return the type id of the Network
Specified by:
getType in interface Net

getTTL

public int getTTL()
Description copied from interface: Net
return the scope of the Network in form of a TTL. This should be replaced by a better mechanism sometime.
Specified by:
getTTL in interface Net

init

public void init(NetReceiver receiver,
                 NetAddress netGroup)
          throws NetException
Description copied from interface: Net
Init the Network.
After calling this method, object can be sent to all instances using the same group and received object from other instances will be forwarded to the NetReceiver.

Options will be taken from the group

Specified by:
init in interface Net
Tags copied from interface: Net
Parameters:
reciever - will receive object from this net
group - the group to create or to join join

flush

public void flush()
           throws NetException
Description copied from interface: Net
send all available data
Specified by:
flush in interface Net

close

public void close()
           throws NetException
Description copied from interface: Net
close the network
Specified by:
close in interface Net

send

public boolean send(java.lang.Object object)
             throws NetException
Description copied from interface: Net
send an Object to the Network
Specified by:
send in interface Net
Tags copied from interface: Net
Parameters:
object - the object to send
Returns:
success

getAddress

public NetAddress getAddress()
                      throws NetException
Description copied from interface: Net
get the NetAddress of this Net
Specified by:
getAddress in interface Net
Tags copied from interface: Net
Returns:
the address

getOptions

public java.lang.Object getOptions()
Description copied from interface: Net
get the options
Specified by:
getOptions in interface Net
Tags copied from interface: Net
Returns:
options

processData

public void processData(inria.net.lrmp.LrmpPacket packet)
Specified by:
processData in interface inria.net.lrmp.LrmpEventHandler

processEvent

public void processEvent(int event,
                         java.lang.Object obj)
Specified by:
processEvent in interface inria.net.lrmp.LrmpEventHandler

seedHack

public void seedHack()
ugly address hack for applications in a session