public void OnMsgGaEntry(Object objMachineid) {
registerMachine(objMachineid);
}
private void registerMachine(Object objMachineid) {
GraderAgent gm = null;
if (objMachineid instanceof GraderAgent)
gm = (GraderAgent) objMachineid;
else {
Syslog.log("!AgentManager: registerMachine: obj not instanceof Agent");
return;
}
machineQueueManager.registerMachine(gm);
// provide obj2astr
String version = gm.getVersion();
if (version == null)
version = "";
String desc = gm.getIP().toString();
Date current = new Date();
String[] aRecord = new String[5];
aRecord[0] = desc;
aRecord[1] = version;
aRecord[2] = "RESERVED";
aRecord[3] = kr.or.ioi2002.RMIServer.Util.DATETIME_FORMAT_DATE.format(current);
aRecord[4] = kr.or.ioi2002.RMIServer.Util.DATETIME_FORMAT_TIME.format(current);
Object objRet = obj2astr.put(gm, aRecord);
if (objRet != null)
Syslog.log("!AgentManager: registerMachine: overwriting existing key in obj2astr: "
+ objRet.toString());
LogGraderAgent.log("registerMachine[" + version + "][" + gm.getIP() + "]");
dispatchJob();
}