Exemplo n.º 1
0
  protected void receiveTunnelInbound(DHTTransportUDPContact originator, Map data) {
    log("Received tunnel inbound message from " + originator.getString());

    try {
      punch_mon.enter();

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

        Object[] wait_data = (Object[]) oustanding_punches.get(i);

        DHTTransportContact wait_contact = (DHTTransportContact) wait_data[0];

        if (originator.getAddress().getAddress().equals(wait_contact.getAddress().getAddress())) {

          wait_data[2] = new Integer(originator.getTransportAddress().getPort());

          ((AESemaphore) wait_data[1]).release();
        }
      }

    } finally {

      punch_mon.exit();
    }
  }
  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);
    }
  }