/**
   * Closes given {@link #transportManagers} of this <tt>Conference</tt> and removes corresponding
   * channel bundle.
   */
  void closeTransportManager(TransportManager transportManager) {
    synchronized (transportManagers) {
      for (Iterator<IceUdpTransportManager> i = transportManagers.values().iterator();
          i.hasNext(); ) {
        if (i.next() == transportManager) {
          i.remove();
          // Presumably, we have a single association for
          // transportManager.
          break;
        }
      }

      // Close manager
      try {
        transportManager.close();
      } catch (Throwable t) {
        logger.warn(
            "Failed to close an IceUdpTransportManager of" + " conference " + getID() + "!", t);
        // The whole point of explicitly closing the
        // transportManagers of this Conference is to prevent memory
        // leaks. Hence, it does not make sense to possibly leave
        // TransportManagers open because a TransportManager has
        // failed to close.
        if (t instanceof InterruptedException) Thread.currentThread().interrupt();
        else if (t instanceof ThreadDeath) throw (ThreadDeath) t;
      }
    }
  }
  /** Closes the {@link #transportManagers} of this <tt>Conference</tt>. */
  private void closeTransportManagers() {
    synchronized (transportManagers) {
      for (Iterator<IceUdpTransportManager> i = transportManagers.values().iterator();
          i.hasNext(); ) {
        IceUdpTransportManager transportManager = i.next();

        i.remove();
        closeTransportManager(transportManager);
      }
    }
  }
  public Map defaultArguments() {
    Map defaults = new LinkedHashMap();
    Collection values = defaultArguments.values();

    Iterator iter = values.iterator();
    while (iter.hasNext()) {
      ArgumentImpl argument = (ArgumentImpl) iter.next();
      defaults.put(argument.name(), argument.clone());
    }
    return defaults;
  }
 public String toString() {
   String string = name() + " (defaults: ";
   Iterator iter = defaultArguments().values().iterator();
   boolean first = true;
   while (iter.hasNext()) {
     ArgumentImpl argument = (ArgumentImpl) iter.next();
     if (!first) {
       string += ", ";
     }
     string += argument.toString();
     first = false;
   }
   return string + ")";
 }
Beispiel #5
0
 public void trim(Coord ul, Coord lr) {
   synchronized (grids) {
     synchronized (req) {
       for (Iterator<Map.Entry<Coord, Grid>> i = grids.entrySet().iterator(); i.hasNext(); ) {
         Map.Entry<Coord, Grid> e = i.next();
         Coord gc = e.getKey();
         Grid g = e.getValue();
         if ((gc.x < ul.x) || (gc.y < ul.y) || (gc.x > lr.x) || (gc.y > lr.y)) i.remove();
       }
       for (Iterator<Coord> i = req.keySet().iterator(); i.hasNext(); ) {
         Coord gc = i.next();
         if ((gc.x < ul.x) || (gc.y < ul.y) || (gc.x > lr.x) || (gc.y > lr.y)) i.remove();
       }
     }
   }
 }
 void getDomChanges(List<DomElement> result, WApplication app) {
   DomElement e = DomElement.getForUpdate(this, this.getDomElementType());
   if (!this.isStubbed() && this.flags_.get(BIT_GRID_CHANGED)) {
     DomElement newE = this.createDomElement(app);
     e.replaceWith(newE);
   } else {
     if (this.rowsChanged_ != null) {
       for (Iterator<WTableRow> i_it = this.rowsChanged_.iterator(); i_it.hasNext(); ) {
         WTableRow i = i_it.next();
         DomElement e2 = DomElement.getForUpdate(i, DomElementType.DomElement_TR);
         i.updateDom(e2, false);
         result.add(e2);
       }
       ;
       this.rowsChanged_ = null;
     }
     if (this.rowsAdded_ != 0) {
       DomElement etb =
           DomElement.getForUpdate(this.getId() + "tb", DomElementType.DomElement_TBODY);
       for (int i = 0; i < (int) this.rowsAdded_; ++i) {
         DomElement tr = this.createRow(this.getRowCount() - this.rowsAdded_ + i, true, app);
         etb.addChild(tr);
       }
       result.add(etb);
       this.rowsAdded_ = 0;
     }
     if (this.flags_.get(BIT_COLUMNS_CHANGED)) {
       for (int i = 0; i < this.columns_.size(); ++i) {
         DomElement e2 =
             DomElement.getForUpdate(this.columns_.get(i), DomElementType.DomElement_COL);
         this.columns_.get(i).updateDom(e2, false);
         result.add(e2);
       }
       this.flags_.clear(BIT_COLUMNS_CHANGED);
     }
     this.updateDom(e, false);
   }
   result.add(e);
 }