示例#1
0
  public void destroy() {
    try {
      server_mon.enter();

      Iterator it = rendezvous_bindings.values().iterator();

      while (it.hasNext()) {

        Object[] entry = (Object[]) it.next();

        final DHTTransportUDPContact contact = (DHTTransportUDPContact) entry[0];

        new AEThread2("DHTNATPuncher:destroy", true) {
          public void run() {
            sendClose(contact);
          }
        }.start();
      }
    } catch (Throwable e) {

      log(e);

    } finally {

      server_mon.exit();
    }
  }
    protected propertyWrapper(Properties _props) {
      Iterator it = _props.keySet().iterator();

      while (it.hasNext()) {

        Object key = it.next();

        put(key, _props.get(key));
      }

      initialising = false;
    }
 public ConfigSection[] getConfigSections() {
   ArrayList<ConfigSection> list = ConfigSectionRepository.getInstance().getList();
   for (Iterator<ConfigSection> iter = list.iterator(); iter.hasNext(); ) {
     ConfigSection configSection = iter.next();
     if (configSection instanceof ConfigSectionHolder) {
       if (((ConfigSectionHolder) configSection).getPluginInterface() != this) {
         iter.remove();
       }
     }
   }
   return list.toArray(new ConfigSection[0]);
 }
  protected void closedownComplete() {
    Iterator it = listeners.iterator();

    while (it.hasNext()) {

      try {
        ((PluginListener) it.next()).closedownComplete();

      } catch (Throwable e) {

        Debug.printStackTrace(e);
      }
    }

    for (int i = 0; i < children.size(); i++) {

      ((PluginInterfaceImpl) children.get(i)).closedownComplete();
    }
  }
  protected void initialisationComplete() {
    Iterator<PluginListener> it = listeners.iterator();

    while (it.hasNext()) {

      try {
        fireInitComplete(it.next());

      } catch (Throwable e) {

        Debug.printStackTrace(e);
      }
    }

    for (int i = 0; i < children.size(); i++) {

      ((PluginInterfaceImpl) children.get(i)).initialisationComplete();
    }
  }
  protected void firePluginEventSupport(PluginEvent event) {
    Iterator<PluginEventListener> it = event_listeners.iterator();

    while (it.hasNext()) {

      try {
        PluginEventListener listener = it.next();

        listener.handleEvent(event);

      } catch (Throwable e) {

        Debug.printStackTrace(e);
      }
    }

    for (int i = 0; i < children.size(); i++) {

      ((PluginInterfaceImpl) children.get(i)).firePluginEvent(event);
    }
  }