DuccId id = null;
try {
id = newId();
} catch ( Exception e ) {
logger.error(methodName, null, e);
ev.setReply(new ServiceReplyEvent(false, "Internal error; unable to generate id", endpoint, -1));
return;
}
logger.debug(methodName, id, "Unique:", id.getUnique());
String logdir = props.getProperty(UiOption.LogDirectory.pname());
if ( !logdir.endsWith("/") ) {
logdir = logdir + "/";
}
logdir = logdir + "S-" + id.toString();
props.put(UiOption.LogDirectory.pname(), logdir);
DuccProperties meta = new DuccProperties();
meta.setProperty("user", user);
meta.setProperty("instances", ""+instances);
meta.setProperty("endpoint", endpoint);
meta.setProperty("numeric_id", id.toString());
meta.setProperty("uuid", id.getUnique());
if ( autostart == Trinary.True ) {
meta.setProperty("autostart", "true");
} else {
meta.setProperty("autostart", "false");
}
String desc_name = descriptor_dir + "/" + id + ".svc";
String meta_name = descriptor_dir + "/" + id + ".meta";
ServiceReplyEvent reply = handler.register(id, desc_name, meta_name, props, meta);
ev.setReply(reply);
// Draw attentipn in the log on registration failures
if ( reply.getReturnCode() ) {
logger.info(methodName, id, ev.toString());
} else {
logger.warn(methodName, id, ev.toString());
}
}