|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectManager
public abstract class Manager
Abstract class defining generic routines for running network code under Fishnet
Method Summary | |
---|---|
void |
addTimer(int nodeAddr,
long deltaT,
Callback callback)
Adds a timer to be fired at deltaT milliseconds in the future |
void |
addTimerAt(int nodeAddr,
long t,
Callback callback)
Adds a timer to be fired at time t |
abstract long |
now()
Retrieve current time in milliseconds |
abstract boolean |
sendNodeMsg(int nodeAddr,
java.lang.String msg)
Sends the msg to the the specified node |
boolean |
sendPkt(int from,
int to,
byte[] pkt)
Send the pkt to the specified node |
void |
setFishnetFile(java.lang.String filename)
Sets the fishnet file that commands should be read from |
void |
setTimescale(double timescale)
Sets the amount to scale real time by. |
abstract void |
start()
Starts the Manager. |
void |
stop()
Stops Fishnet. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public abstract void start()
public void stop()
public void setFishnetFile(java.lang.String filename) throws java.io.FileNotFoundException
filename
- The name of the file that commands should be read from
java.io.FileNotFoundException
- If the named filed does not exist, is a directory rather than a regular file, or
for some other reason cannot be opened for readingpublic boolean sendPkt(int from, int to, byte[] pkt) throws java.lang.IllegalArgumentException
from
- The node that is sending the packetto
- Int spefying the destination nodepkt
- The packet to be sent, serialized to a byte array
java.lang.IllegalArgumentException
- If the arguments are invalidpublic void addTimerAt(int nodeAddr, long t, Callback callback)
nodeAddr
- Addr of node that is registering this timert
- The time when the timer should fire. In millisecondscallback
- The callback to be invoked when the timer firespublic void addTimer(int nodeAddr, long deltaT, Callback callback)
nodeAddr
- Addr of node that is registering this timerdeltaT
- The time interval after which the timer should fire. In millisecondscallback
- The callback to be invoked when the timer firespublic abstract long now()
public abstract boolean sendNodeMsg(int nodeAddr, java.lang.String msg)
nodeAddr
- Address of the node to whom the message should be sentmsg
- The msg to send to the node
public void setTimescale(double timescale)
timescale
- The amount to scale real time by
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |