AgentId adminId,
String destClassName,
byte type,
Properties properties,
boolean freerw) throws Exception {
AgentId destId = null;
StringBuffer strbuf = new StringBuffer();
DestinationDesc destDesc = null;
try {
destDesc = AdminTopic.createDestinationAndSave(destName, adminId, properties,
type, destClassName,
"JoramHelper", strbuf);
} catch (Exception exc) {
logger.log(BasicLevel.ERROR, "JoramHelper.createDestination, Cannot create destination " + destName, exc);
throw exc;
}
destId = destDesc.getId();
if (logger.isLoggable(BasicLevel.DEBUG))
logger.log(BasicLevel.DEBUG, "JoramHelper.createDestination info = " + strbuf.toString());
strbuf.setLength(0);
if (freerw) {
try {
AdminTopic.setRightAndSave(new SetReader(null, destId.toString()), null, "-1");
} catch (Exception exc) {
if (logger.isLoggable(BasicLevel.ERROR))
logger.log(BasicLevel.ERROR, "JoramHelper.createDestination, Cannot set FreeReader", exc);
}
try {
AdminTopic.setRightAndSave(new SetWriter(null, destId.toString()), null, "-1");
} catch (Exception exc) {
if (logger.isLoggable(BasicLevel.ERROR))
logger.log(BasicLevel.ERROR, "JoramHelper.createDestination, Cannot set FreeWriter", exc);
}
}