Interface Peer

All Superinterfaces:
java.rmi.Remote
All Known Implementing Classes:
MsgReceiver

public interface Peer
extends java.rmi.Remote

This class provides an interface for the remote method of PEs.

Version:
2.0 (10.2006)
Author:
Yin Xiong

Method Summary
 int receiveMsg(Message msg)
          Receives a message from a remote PE.
 void setEOSflag(int f)
          Sets the end-of-simulation flag
 void shutDown()
          Shuts down ththe RMI server running on this PE by invoking its unexportObject method.
 

Method Detail

receiveMsg

int receiveMsg(Message msg)
               throws java.rmi.RemoteException
Receives a message from a remote PE. This is the most important function of Peer.

Parameters:
msg - a Message object that is to be sent to this PE.
Throws:
java.rmi.RemoteException

shutDown

void shutDown()
              throws java.rmi.RemoteException
Shuts down ththe RMI server running on this PE by invoking its unexportObject method. Note that the invokation of this mehtod must be another thread.

Throws:
java.rmi.RemoteException

setEOSflag

void setEOSflag(int f)
                throws java.rmi.RemoteException
Sets the end-of-simulation flag

Parameters:
f - int the value this flag is going to be set to.
Throws:
java.rmi.RemoteException