/** Fire hostDisconnectEvent events. */
  void fireDisconnectedEvents() {
    ArrayList registered = null;
    HostEvent ev = null;

    synchronized (listeners) {
      registered = (ArrayList) listeners.clone();
    }

    for (Iterator i = registered.iterator(); i.hasNext(); /* empty */ ) {
      HostListener l = (HostListener) i.next();
      if (ev == null) {
        ev = new HostEvent(this);
      }
      l.disconnected(ev);
    }
  }
  /**
   * Fire VmStatusChangeEvent events to HostListener objects
   *
   * @param active Set of Integer objects containing the local Vm Identifiers of the active JVMs
   * @param started Set of Integer objects containing the local Vm Identifiers of new JVMs started
   *     since last interval.
   * @param terminated Set of Integer objects containing the local Vm Identifiers of terminated JVMs
   *     since last interval.
   */
  private void fireVmStatusChangedEvents(Set active, Set started, Set terminated) {
    ArrayList registered = null;
    VmStatusChangeEvent ev = null;

    synchronized (listeners) {
      registered = (ArrayList) listeners.clone();
    }

    for (Iterator i = registered.iterator(); i.hasNext(); /* empty */ ) {
      HostListener l = (HostListener) i.next();
      if (ev == null) {
        ev = new VmStatusChangeEvent(this, active, started, terminated);
      }
      l.vmStatusChanged(ev);
    }
  }