private void disposeCollection(Collection collection) {
    final Iterator i = collection.iterator();

    while (i.hasNext()) {
      final Object o = i.next();

      try {
        Disposable disposable = (Disposable) o;

        try {
          ((AbstractPoolable) o).setObjectPool(null);
        } catch (ClassCastException e) {
          // ignored
        }

        disposable.dispose();
      } catch (ClassCastException e) {
        // ignored
      }
    }
  }
示例#2
0
 public void doActivateObject(Object o) {
   ((AbstractPoolable) o).setObjectPool(this);
 }