|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.cmu.emulator.daemon.DaemonCommunicator
public class DaemonCommunicator
This class is responsible for communicating with the daemons running on the remote nodes.It maintains a mapping of the nodes and a reference to the daemon stubs. This way, when the class methods are invoked to perform a remote invocation on a specific node's daemon, the class will find the daemon stub exported by that daemon and perform the remote method invocation on its behalf, returning the result to the user code.
DaemonInterface
,
NodeDaemon
Field Summary | |
---|---|
private EmuInterface |
emu
The RMI interface on the Emulator |
private RWLock |
execLock
|
protected String |
HostIP
|
protected static int |
JE_RMI_HOSTNAME_INDEX
Default location of the hostname |
protected static String |
JEXEC_CMD_0_HEAD
part of the Default Java command that starts the rmi server on the emulator |
protected static String |
JEXEC_CMD_0_TAIL
|
protected static String |
JEXEC_CMD_1_HEAD
part of the Default Java command that starts the rmi server on the emulator |
protected static String |
JEXEC_CMD_1_TAIL
|
protected static String[] |
JEXEC_CMDS
Default Java command that starts the rmi server on the emulator |
protected Logger |
log
|
private HashMap |
map
map nodes to RMI stubs |
private MessageCenter |
msgCenter
The message center |
private DaemonInterface[] |
nodeDaemonStubs
The nodeDaemon Interface (stub on emulator) |
private HashMap |
procListenerMap
map processes to listeners |
static boolean |
verboseDC
Verbose display control |
private EmuWorld |
world
The experiment EmuWorld |
Constructor Summary | |
---|---|
DaemonCommunicator(EmuWorld world)
Constructor. |
Method Summary | |
---|---|
void |
exec(String nodeName,
String cmd,
Boolean asynchronousObj,
Boolean exitOnErrorObj,
LogSpec logSpec)
|
RemoteProcess |
execProcess_CentralLogIO(String nodeName,
String[] cmds,
String stdoutFileName,
String stderrFileName,
ProcListener pl)
Execute a list of commands on a remote node |
RemoteProcess |
execProcess_CentralLogIO(String nodeName,
String cmds,
String stdoutFileName,
String stderrFileName)
Execute a command on a remote node |
RemoteProcess |
execProcess_CentralLogIO(String nodeName,
String cmds,
String stdoutFileName,
String stderrFileName,
ProcListener pl)
Execute a command on a remote node |
RemoteProcess |
execProcess_ConsoleIO(String nodeName,
String[] cmds,
int ioOptions,
ProcListener pl)
Execute a list of commands on a remote node |
RemoteProcess |
execProcess_ConsoleIO(String nodeName,
String cmds,
int ioOptions,
ProcListener pl)
Execute a command on a remote node |
RemoteProcess |
execProcess_NodeLogIO(String nodeName,
String[] cmds,
String stdoutFileName,
String stderrFileName,
ProcListener pl)
Execute a list of commands on a remote node |
RemoteProcess |
execProcess_NodeLogIO(String nodeName,
String cmds,
String stdoutFileName,
String stderrFileName,
ProcListener pl)
Execute a command on a remote node |
RemoteProcess |
execProcess_RelayIO(String nodeName,
String[] cmds,
int ioOptions,
ProcListener pl)
Execute a list of commands on a remote node |
RemoteProcess |
execProcess_RelayIO(String nodeName,
String cmds,
int ioOptions,
ProcListener pl)
Execute a command on a remote node |
RemoteProcess |
execProcess(String nodeName,
String[] cmds,
ProcControl pc,
ProcListener pl)
Execute a list of commands on a remote node |
RemoteProcess |
execProcess(String nodeName,
String[] cmds,
ProcListener pl)
Execute a list of commands on a remote node |
RemoteProcess |
execProcess(String nodeName,
String cmds,
ProcControl pc,
ProcListener pl)
Execute a command on a remote node |
RemoteProcess |
execProcess(String nodeName,
String cmds,
ProcListener pl)
Execute a command on a remote node |
int |
execProcessAndWait_CentralLogIO(String nodeName,
String[] cmds,
String stdoutFileName,
String stderrFileName)
Execute a list of commands on a remote node, and wait for returned values |
int |
execProcessAndWait_CentralLogIO(String nodeName,
String cmds,
String stdoutFileName,
String stderrFileName)
Execute a command on a remote node, and wait for returned values |
int |
execProcessAndWait_ConsoleIO(String nodeName,
String cmds)
Execute a command on a remote node, and wait for returned values |
int |
execProcessAndWait_ConsoleIO(String nodeName,
String[] cmds,
int ioOptions)
Execute a list of commands on a remote node, and wait for returned values |
int |
execProcessAndWait_ConsoleIO(String nodeName,
String cmds,
int ioOptions)
Execute a command on a remote node, and wait for returned values |
int |
execProcessAndWait_NodeLogIO(String nodeName,
String[] cmds,
String stdoutFileName,
String stderrFileName)
Execute a list of commands on a remote node, and wait for returned values |
int |
execProcessAndWait_NodeLogIO(String nodeName,
String cmds,
String stdoutFileName,
String stderrFileName)
Execute a command on a remote node, and wait for returned values |
int |
execProcessAndWait(String nodeName,
String cmds)
Execute a command on a remote node, and wait for returned values |
int |
execProcessAndWait(String nodeName,
String[] cmds)
Execute a list of commands on a remote node, and wait for returned values |
int |
execProcessAndWait(String nodeName,
String[] cmds,
ProcControl pc)
Execute a list of commands on a remote node, and wait for returned values |
int |
execProcessAndWait(String nodeName,
String cmds,
ProcControl pc)
Execute a command on a remote node, and wait for returned values |
protected ProcessID |
finishExec(String nodeName,
int pID,
ProcListener pl)
|
DaemonInterface |
getDaemonStub(String nodeName)
obtain the Daemon Interface for the node |
RemoteProcess |
jExec_CentralLogIO(String nodeName,
String[] cmds,
String stdoutFileName,
String stderrFileName,
ProcListener pl)
Execute a list of commands on a remote node |
RemoteProcess |
jExec_CentralLogIO(String nodeName,
String cmds,
String stdoutFileName,
String stderrFileName,
ProcListener pl)
Execute a command on a remote node |
RemoteProcess |
jExec_NodeLogIO(String nodeName,
String[] cmds,
String stdoutFileName,
String stderrFileName,
ProcListener pl)
Execute a list of commands on a remote node |
RemoteProcess |
jExec_NodeLogIO(String nodeName,
String cmds,
String stdoutFileName,
String stderrFileName,
ProcListener pl)
Execute a command on a remote node |
RemoteProcess |
jExec_RelayIO(String nodeName,
String[] cmds,
int ioOptions,
ProcListener pl)
Execute a list of commands on a remote node |
RemoteProcess |
jExec_RelayIO(String nodeName,
String cmds,
int ioOptions,
ProcListener pl)
Execute a command on a remote node |
RemoteProcess |
jExec(String nodeName,
String[] cmds,
ProcControl pc,
ProcListener pl)
Execute a list of commands on a remote node |
RemoteProcess |
jExec(String nodeName,
String[] cmds,
ProcListener pl)
Execute a list of commands on a remote node |
RemoteProcess |
jExec(String nodeName,
String cmds,
ProcControl pc,
ProcListener pl)
Execute a command on a remote node |
RemoteProcess |
jExec(String nodeName,
String cmds,
ProcListener pl)
Execute a command on a remote node |
int |
jExecAndWait_CentralLogIO(String nodeName,
String[] cmds,
String stdoutFileName,
String stderrFileName)
Execute a list of commands on a remote node, and wait for returned values |
int |
jExecAndWait_CentralLogIO(String nodeName,
String cmds,
String stdoutFileName,
String stderrFileName)
Execute a command on a remote node, and wait for returned values |
int |
jExecAndWait_NodeLogIO(String nodeName,
String[] cmds,
String stdoutFileName,
String stderrFileName)
Execute a list of commands on a remote node, and wait for returned values |
int |
jExecAndWait_NodeLogIO(String nodeName,
String cmds,
String stdoutFileName,
String stderrFileName)
Execute a command on a remote node, and wait for returned values |
int |
jExecAndWait(String nodeName,
String cmds)
Execute a command on a remote node, and wait for returned values |
int |
jExecAndWait(String nodeName,
String[] cmds)
Execute a list of commands on a remote node, and wait for returned values |
int |
jExecAndWait(String nodeName,
String[] cmds,
ProcControl pc)
Execute a list of commands on a remote node, and wait for returned values |
int |
jExecAndWait(String nodeName,
String cmds,
ProcControl pc)
Execute a command on a remote node, and wait for returned values |
protected String |
jExecCmd(String cmd,
String nodeName)
Create the Java command string to execute a command on a remote node |
protected String[] |
jExecCmds(String[] cmds,
String nodeName)
Create an array of Java command strings to execute a list of commands on a remote node |
void |
mapDaemonStubs(SchedClient schedClient,
EmuNode[] nodes)
map each emuNode to the daemon stub on the remote node |
void |
message(ProcessID pID,
Object msg)
|
void |
notifyProcExit(String nodeName,
int procID,
int code)
|
void |
reInitNodes()
|
void |
stopProcess(ProcessID processID)
Note - should remove process from ProcListenerMap... |
protected static String[] |
stringToArgs(String argString)
|
Object |
waitForMessage(ProcessID pID)
|
Object |
waitForMessage(ProcessID pID,
long timeoutMillis)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private EmuInterface emu
private EmuWorld world
private DaemonInterface[] nodeDaemonStubs
NodeDaemon
private HashMap map
private HashMap procListenerMap
private MessageCenter msgCenter
private RWLock execLock
public static boolean verboseDC
default value is false
protected Logger log
protected String HostIP
protected static final String JEXEC_CMD_0_HEAD
java -cp ~/emuNode/boot.jar -Djava.rmi.server.codebase=http://10.96.128.1:8180/ -Djava.rmi.security.policy=~/emuNode/java.policy -Djava.rmi.server.hostname=
protected static final String JEXEC_CMD_0_TAIL
protected static final String JEXEC_CMD_1_HEAD
edu.cmu.emulator.boot.NodeBoot http://10.96.128.1:8180/
protected static final String JEXEC_CMD_1_TAIL
protected static final String[] JEXEC_CMDS
java", "-cp", "~/emuNode/boot.jar -Djava.rmi.server.codebase=http://10.96.128.1:8180/ -Djava.rmi.security.policy=~/emuNode/java.policy -Djava.rmi.server.hostname= edu.cmu.emulator.boot.NodeBoot http://10.96.128.1:8180/
protected static final int JE_RMI_HOSTNAME_INDEX
Default value is 5
Constructor Detail |
---|
public DaemonCommunicator(EmuWorld world)
Method Detail |
---|
protected String jExecCmd(String cmd, String nodeName)
cmd
- - command; nodeName - the name of the remote node
protected String[] jExecCmds(String[] cmds, String nodeName)
cmds
- - list of commands; nodeName - the name of the remote node
public int jExecAndWait(String nodeName, String cmds, ProcControl pc)
cmds
- - command; nodeName - the name of the remote node
execProcessAndWait(String nodeName, String cmds, ProcControl pc)
public int jExecAndWait(String nodeName, String cmds)
cmds
- - command; nodeName - the name of the remote node
execProcessAndWait(String nodeName, String cmds)
public int jExecAndWait_NodeLogIO(String nodeName, String cmds, String stdoutFileName, String stderrFileName)
The console output is saved on the remote node locally specified by the stdout and stderr file name
cmds
- - command; nodeName - the name of the remote node; stdoutFileName - stdout Filename; stderrFileName - stderr Filename;
execProcessAndWait_NodeLogIO(String nodeName, String cmds, String stdoutFileName, String stderrFileName)
public int jExecAndWait_CentralLogIO(String nodeName, String cmds, String stdoutFileName, String stderrFileName)
The console output is saved on the central controller (emucontrol-1) specified by the stdout and stderr file name
cmds
- - command; nodeName - the name of the remote node; stdoutFileName - stdout Filename; stderrFileName - stderr Filename;
execProcessAndWait_CentralLogIO(String nodeName, String cmds, String stdoutFileName, String stderrFileName)
public int jExecAndWait(String nodeName, String[] cmds)
cmds
- - command; nodeName - the name of the remote node
execProcessAndWait(String nodeName, String[] cmds)
public int jExecAndWait(String nodeName, String[] cmds, ProcControl pc)
cmds
- - command; nodeName - the name of the remote node
execProcessAndWait(String nodeName, String[] cmds, ProcControl pc)
public int jExecAndWait_NodeLogIO(String nodeName, String[] cmds, String stdoutFileName, String stderrFileName)
The console output is saved on the remote node locally specified by the stdout and stderr file name
cmds
- - a list commands; nodeName - the name of the remote node; stdoutFileName - stdout Filename; stderrFileName - stderr Filename;
execProcessAndWait_NodeLogIO(String nodeName, String[] cmds, String stdoutFileName, String stderrFileName)
public int jExecAndWait_CentralLogIO(String nodeName, String[] cmds, String stdoutFileName, String stderrFileName)
The console output is saved on the central controller (emucontrol-1) specified by the stdout and stderr file name
cmds
- - command array; nodeName - the name of the remote node; stdoutFileName - stdout Filename; stderrFileName - stderr Filename;
execProcessAndWait_CentralLogIO(String nodeName, String[] cmds, String stdoutFileName, String stderrFileName)
public RemoteProcess jExec(String nodeName, String cmds, ProcControl pc, ProcListener pl)
cmds
- - command; nodeName - the name of the remote node; pc - process controller; pl: process listener
execProcess(String nodeName, String cmds, ProcControl pc, ProcListener pl)
public RemoteProcess jExec(String nodeName, String cmds, ProcListener pl)
cmds
- - command; nodeName - the name of the remote node; pl: process listener
execProcess(String nodeName, String cmds, ProcListener pl)
public RemoteProcess jExec_NodeLogIO(String nodeName, String cmds, String stdoutFileName, String stderrFileName, ProcListener pl)
The console output is saved on the remote node locally specified by the stdout and stderr file name
cmds
- - command; nodeName - the name of the remote node; stdoutFileName - stdout Filename; stderrFileName - stderr Filename; pl: process listener
execProcess_NodeLogIO(String nodeName, String cmds, String stdoutFileName, String stderrFileName, ProcListener pl)
public RemoteProcess jExec_CentralLogIO(String nodeName, String cmds, String stdoutFileName, String stderrFileName, ProcListener pl)
The console output is saved on the central controller (emucontrol-1) specified by the stdout and stderr file name
cmds
- - command; nodeName - the name of the remote node; stdoutFileName - stdout Filename; stderrFileName - stderr Filename; pl: process listener
execProcess_CentralLogIO(String nodeName, String cmds, String stdoutFileName, String stderrFileName, ProcListener pl)
public RemoteProcess jExec_RelayIO(String nodeName, String cmds, int ioOptions, ProcListener pl)
The console output is relayed to current console (on emucontrol-1)
cmds
- - command; nodeName - the name of the remote node; stdoutFileName - stdout Filename; stderrFileName - stderr Filename; pl: process listenerioOptions
- - 0 does not display output, 1 show console output
execProcess_RelayIO(String nodeName, String cmds, int ioOptions, ProcListener pl)
public RemoteProcess jExec(String nodeName, String[] cmds, ProcControl pc, ProcListener pl)
cmds
- - command; nodeName - the name of the remote node; pc - process controller; pl: process listener
execProcess(String nodeName, String[] cmds, ProcControl pc, ProcListener pl)
public RemoteProcess jExec(String nodeName, String[] cmds, ProcListener pl)
cmds
- - command; nodeName - the name of the remote node; pl: process listener
execProcess(String nodeName, String[] cmds, ProcListener pl)
public RemoteProcess jExec_NodeLogIO(String nodeName, String[] cmds, String stdoutFileName, String stderrFileName, ProcListener pl)
The console output is saved on the central controller (emucontrol-1) specified by the stdout and stderr file name
cmds
- - command array; nodeName - the name of the remote node; stdoutFileName - stdout Filename; stderrFileName - stderr Filename; pl: process listener
execProcess_NodeLogIO(String nodeName, String[] cmds, String stdoutFileName, String stderrFileName, ProcListener pl)
public RemoteProcess jExec_RelayIO(String nodeName, String[] cmds, int ioOptions, ProcListener pl)
The console output is relayed to current console (on emucontrol-1)
cmds
- - command; nodeName - the name of the remote node; stdoutFileName - stdout Filename; stderrFileName - stderr Filename; pl: process listenerioOptions
- - 0 does not display output, 1 show console output
execProcess_RelayIO(String nodeName, String[] cmds, int ioOptions, ProcListener pl)
public RemoteProcess jExec_CentralLogIO(String nodeName, String[] cmds, String stdoutFileName, String stderrFileName, ProcListener pl)
The console output is saved on the central controller (emucontrol-1) specified by the stdout and stderr file name
cmds
- - command; nodeName - the name of the remote node; stdoutFileName - stdout Filename; stderrFileName - stderr Filename; pl: process listener
execProcess_CentralLogIO(String nodeName, String[] cmds, String stdoutFileName, String stderrFileName, ProcListener pl)
public void exec(String nodeName, String cmd, Boolean asynchronousObj, Boolean exitOnErrorObj, LogSpec logSpec)
public int execProcessAndWait_ConsoleIO(String nodeName, String cmds)
The output is displayed directly in the console (on emucontrol-1)
cmds
- - command; nodeName - the name of the remote node;
public int execProcessAndWait(String nodeName, String cmds, ProcControl pc)
cmds
- - command; nodeName - the name of the remote node; pc: process controller
public int execProcessAndWait(String nodeName, String cmds)
cmds
- - command; nodeName - the name of the remote node;
public int execProcessAndWait_NodeLogIO(String nodeName, String cmds, String stdoutFileName, String stderrFileName)
The console output is saved on the remote node specified by the stdout and stderr file name
cmds
- - command; nodeName - the name of the remote node; stdoutFileName - stdout Filename; stderrFileName - stderr Filename;
public int execProcessAndWait_CentralLogIO(String nodeName, String cmds, String stdoutFileName, String stderrFileName)
The console output is saved on the central controller (emucontrol-1) specified by the stdout and stderr file name
cmds
- - command; nodeName - the name of the remote node; stdoutFileName - stdout Filename; stderrFileName - stderr Filename;
public int execProcessAndWait_ConsoleIO(String nodeName, String cmds, int ioOptions)
The output is displayed directly in the console (on emucontrol-1)
cmds
- - command; nodeName - the name of the remote node;ioOptions
- - 0 does not display result, 1 show result
public int execProcessAndWait(String nodeName, String[] cmds)
cmds
- - command array; nodeName - the name of the remote node;
public int execProcessAndWait(String nodeName, String[] cmds, ProcControl pc)
cmds
- - command array; nodeName - the name of the remote node; pc: process controller
public int execProcessAndWait_NodeLogIO(String nodeName, String[] cmds, String stdoutFileName, String stderrFileName)
The console output is saved on the remote node specified by the stdout and stderr file name
cmds
- - command array; nodeName - the name of the remote node; stdoutFileName - stdout Filename; stderrFileName - stderr Filename;
public int execProcessAndWait_CentralLogIO(String nodeName, String[] cmds, String stdoutFileName, String stderrFileName)
The console output is saved on the central controller (emucontrol-1) specified by the stdout and stderr file name
cmds
- - command array; nodeName - the name of the remote node; stdoutFileName - stdout Filename; stderrFileName - stderr Filename;
public int execProcessAndWait_ConsoleIO(String nodeName, String[] cmds, int ioOptions)
The output is displayed directly in the console (on emucontrol-1)
cmds
- - command array; nodeName - the name of the remote node;ioOptions
- - 0 does not display result, 1 show result
public RemoteProcess execProcess(String nodeName, String cmds, ProcControl pc, ProcListener pl)
cmds
- - command; nodeName - the name of the remote node; pc: Process Controller pl: process listener
public RemoteProcess execProcess(String nodeName, String cmds, ProcListener pl)
cmds
- - command; nodeName - the name of the remote node; pl: process listener
public RemoteProcess execProcess_NodeLogIO(String nodeName, String cmds, String stdoutFileName, String stderrFileName, ProcListener pl)
The output is saved on the remote node locally
cmds
- - command; nodeName - the name of the remote node; stdoutFileName - stdout Filename; stderrFileName - stderr Filename; pl: process listener
public RemoteProcess execProcess_CentralLogIO(String nodeName, String cmds, String stdoutFileName, String stderrFileName)
The output is saved on the central controller ( emucontrol-1)
cmds
- - command; nodeName - the name of the remote node; stdoutFileName - stdout Filename; stderrFileName - stderr Filename;
public RemoteProcess execProcess_CentralLogIO(String nodeName, String cmds, String stdoutFileName, String stderrFileName, ProcListener pl)
The output is saved on the central controller ( emucontrol-1)
cmds
- - command; nodeName - the name of the remote node; stdoutFileName - stdout Filename; stderrFileName - stderr Filename; pl: process listener
public RemoteProcess execProcess_ConsoleIO(String nodeName, String cmds, int ioOptions, ProcListener pl)
The output is displayed directly in the console (on emucontrol-1)
cmds
- - command; nodeName - the name of the remote node; pl: process listenerioOptions
- - 0 does not display result, 1 show result
public RemoteProcess execProcess_RelayIO(String nodeName, String cmds, int ioOptions, ProcListener pl)
The output is relayed to the current console
cmds
- - command; nodeName - the name of the remote node; pl: process listenerioOptions
- - 0 does not display result, 1 show result
public RemoteProcess execProcess(String nodeName, String[] cmds, ProcControl pc, ProcListener pl)
cmds
- - command array; nodeName - the name of the remote node; pc: process controller; pl: process listener
public RemoteProcess execProcess(String nodeName, String[] cmds, ProcListener pl)
cmds
- - command array; nodeName - the name of the remote node; pl: process listener
public RemoteProcess execProcess_NodeLogIO(String nodeName, String[] cmds, String stdoutFileName, String stderrFileName, ProcListener pl)
The output is saved on the remote node locally
cmds
- - command array; nodeName - the name of the remote node; stdoutFileName - stdout Filename; stderrFileName - stderr Filename; pl: process listener
public RemoteProcess execProcess_RelayIO(String nodeName, String[] cmds, int ioOptions, ProcListener pl)
The output is relayed to the current console
cmds
- - command array; nodeName - the name of the remote node; pl: process listenerioOptions
- - 0 does not display result, 1 show result
public RemoteProcess execProcess_CentralLogIO(String nodeName, String[] cmds, String stdoutFileName, String stderrFileName, ProcListener pl)
The output is saved on the central controller ( emucontrol-1)
cmds
- - command array; nodeName - the name of the remote node; stdoutFileName - stdout Filename; stderrFileName - stderr Filename; pl: process listener
public RemoteProcess execProcess_ConsoleIO(String nodeName, String[] cmds, int ioOptions, ProcListener pl)
The output is displayed directly in the console (on emucontrol-1)
cmds
- - command array; nodeName - the name of the remote node; pl: process listenerioOptions
- - 0 does not display result, 1 show result
protected ProcessID finishExec(String nodeName, int pID, ProcListener pl)
public void notifyProcExit(String nodeName, int procID, int code)
public void stopProcess(ProcessID processID)
public void mapDaemonStubs(SchedClient schedClient, EmuNode[] nodes)
public DaemonInterface getDaemonStub(String nodeName)
protected static String[] stringToArgs(String argString)
public void reInitNodes()
public void message(ProcessID pID, Object msg)
public Object waitForMessage(ProcessID pID)
public Object waitForMessage(ProcessID pID, long timeoutMillis)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |