示例#1
0
  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();
    }
  }
示例#2
0
  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();
    }
  }
示例#3
0
  public void mappingDestroyed(UPnPMapping mapping) {
    try {
      this_mon.enter();

      mappings.remove(mapping);

      log.log("Mapping request removed: " + mapping.getString());

      for (int j = 0; j < services.size(); j++) {

        UPnPPluginService service = (UPnPPluginService) services.get(j);

        service.removeMapping(log, mapping, false);
      }
    } finally {

      this_mon.exit();
    }
  }