edu.cmu.emulator.daemon
Class NodeDaemon
java.lang.Object
java.rmi.server.RemoteObject
java.rmi.server.RemoteServer
java.rmi.server.UnicastRemoteObject
edu.cmu.emulator.daemon.NodeDaemon
- All Implemented Interfaces:
- DaemonInterface, Serializable, Runnable, Remote
public class NodeDaemon
- extends UnicastRemoteObject
- implements DaemonInterface, Runnable
The Daemon that runs on the nodes. This will be the server
side of the RMI package.
- See Also:
- Serialized Form
processMap
private HashMap processMap
nextProcID
private int nextProcID
emu
private EmuInterface emu
nodeName
private String nodeName
reapList
private ArrayList reapList
reaping
private boolean reaping
INVALID_PID
public static final int INVALID_PID
- See Also:
- Constant Field Values
emuHost
private static String emuHost
reapIntervalMillis
public static final int reapIntervalMillis
- See Also:
- Constant Field Values
sw
public static final Stopwatch sw
NodeDaemon
public NodeDaemon()
throws RemoteException
- Throws:
RemoteException
init
public void init(String nodeName,
EmuInterface emu)
- Specified by:
init
in interface DaemonInterface
addProcessToMap
private int addProcessToMap(Process p)
removeProcessFromMap
private Process removeProcessFromMap(int pID)
getProcessInMap
private Process getProcessInMap(Integer pID)
getProcessInMap
private Process getProcessInMap(int pID)
execProcess
public int execProcess(String[] cmds,
ProcControl pc)
- Fundamental execProcess routine.
- Specified by:
execProcess
in interface DaemonInterface
- Parameters:
cmds
- The array of strings which holds the command
name and the arguements
- Returns:
- The ID of the process created
execProcess
public int execProcess(String[] cmds)
- Specified by:
execProcess
in interface DaemonInterface
execProcess_NodeLogIO
public int execProcess_NodeLogIO(String[] cmds,
String stdoutLogName,
String stderrLogName)
- Convenience routine to execProcess and log stdout and/or stderr on
the node.
- Specified by:
execProcess_NodeLogIO
in interface DaemonInterface
execProcess_RelayIO
public int[] execProcess_RelayIO(String[] cmds,
int ioOptions)
- Description copied from interface:
DaemonInterface
- Convenience routine to relay io to/from control node.
- Specified by:
execProcess_RelayIO
in interface DaemonInterface
getNodeName
public String getNodeName()
getEmuInterface
public EmuInterface getEmuInterface()
stopProcess
public void stopProcess(int pID)
- Description copied from interface:
DaemonInterface
- Stop a remote process.
- Specified by:
stopProcess
in interface DaemonInterface
- Parameters:
pID
- The ID of the remote process.
reInit
public void reInit()
- Specified by:
reInit
in interface DaemonInterface
getProcessIDList
public ArrayList getProcessIDList()
sendMessageToEmu
public void sendMessageToEmu(int pID,
Object msg)
run
public void run()
- Specified by:
run
in interface Runnable
main
public static void main(String[] args)
Copyright © 2013. All Rights Reserved.