@Override public void register(int id, MessageTemplate template) { define(template); Integer tid = new Integer(id); idMap.put(id, template); templateMap.put(template, tid); notifyTemplateRegistered(template, id); }
@Override public void register(int id, QName name) { if (!nameMap.containsKey(name)) { throw new IllegalArgumentException("The template named " + name + " is not defined."); } Integer tid = new Integer(id); MessageTemplate template = nameMap.get(name); templateMap.put(template, tid); idMap.put(id, template); notifyTemplateRegistered(template, id); }