public void generate(IndentWriter writer) { List<UPnPMapping> mappings_copy; List<UPnPPluginService> services_copy; try { this_mon.enter(); mappings_copy = new ArrayList<UPnPMapping>(mappings); services_copy = new ArrayList<UPnPPluginService>(services); } finally { this_mon.exit(); } writer.println("Mappings"); try { writer.indent(); for (UPnPMapping mapping : mappings_copy) { if (mapping.isEnabled()) { writer.println(mapping.getString()); } } } finally { writer.exdent(); } writer.println("Services"); try { writer.indent(); for (UPnPPluginService service : services_copy) { writer.println(service.getString()); } } finally { writer.exdent(); } }
protected void addMapping(UPnPMapping mapping) { try { this_mon.enter(); mappings.add(mapping); log.log("Mapping request: " + mapping.getString() + ", enabled = " + mapping.isEnabled()); mapping.addListener(this); checkState(); } finally { this_mon.exit(); } }