|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.rmi.server.RemoteObject
java.rmi.server.RemoteServer
java.rmi.server.UnicastRemoteObject
MsgReceiver
public class MsgReceiver
This is a RMI-specific class. It creates a rmi server and runs it until it is shut down from outside by the GNS server.
Field Summary | |
---|---|
(package private) Flag |
flag
the end of simulation flag that is shared by the rmi sender thread, the rmi receiver thread and the SchedulingLoop thread. |
(package private) java.util.concurrent.PriorityBlockingQueue<Message> |
msgQueue
the queue that contains the incoming message and is shared with the SchedulingLoop |
(package private) java.lang.String |
myip
the IP address of the machine on which this rmi server is running |
(package private) java.lang.String |
myMachineName
the name of the machine on which this rmi server is running |
Fields inherited from class java.rmi.server.RemoteObject |
---|
ref |
Constructor Summary | |
---|---|
MsgReceiver(java.util.concurrent.PriorityBlockingQueue<Message> mq,
Flag f)
constructs a MsgReceiver object. |
Method Summary | |
---|---|
int |
receiveMsg(Message message)
Receives messages. |
void |
run()
Runs this thread. |
void |
setEOSflag(int f)
Sets the end of sim flag so any PE that enquires about the end of simulation will get the same value. |
void |
shutDown()
Remotely shuts down the rmi servers running on the PEs. |
Methods inherited from class java.rmi.server.UnicastRemoteObject |
---|
clone, exportObject, exportObject, exportObject, unexportObject |
Methods inherited from class java.rmi.server.RemoteServer |
---|
getClientHost, getLog, setLog |
Methods inherited from class java.rmi.server.RemoteObject |
---|
equals, getRef, hashCode, toString, toStub |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
java.util.concurrent.PriorityBlockingQueue<Message> msgQueue
java.lang.String myip
java.lang.String myMachineName
Flag flag
Constructor Detail |
---|
public MsgReceiver(java.util.concurrent.PriorityBlockingQueue<Message> mq, Flag f) throws java.rmi.RemoteException
mq
- a PriorityBlockingQueue that contains the incoming message and is
shared with the SchedulingLoopf
- a Flag object indicating the end of simulation and is shared among
three threads running on this PE.
java.rmi.RemoteException
Method Detail |
---|
public void run()
run
in interface java.lang.Runnable
public void setEOSflag(int f)
setEOSflag
in interface Peer
f
- int the value to be set to the flag. Negative value indicates the end of
simulation.public void shutDown()
shutDown
in interface Peer
public int receiveMsg(Message message)
receiveMsg
in interface Peer
message
- a Message object that is to be sent to a PE.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |