java.util.Observable.deleteObserver()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(5.9k)|赞(0)|评价(0)|浏览(121)

本文整理了Java中java.util.Observable.deleteObserver()方法的一些代码示例,展示了Observable.deleteObserver()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Observable.deleteObserver()方法的具体详情如下:
包路径:java.util.Observable
类名称:Observable
方法名:deleteObserver

Observable.deleteObserver介绍

[英]Removes the specified observer from the list of observers. Passing null won't do anything.
[中]从观察者列表中删除指定的观察者。传递null不会起任何作用。

代码示例

代码示例来源:origin: sd4324530/fastweixin

/**
 * 移除配置变化监听器
 *
 * @param handle 监听器
 */
public void removeHandle(final ApiConfigChangeHandle handle) {
  super.deleteObserver(handle);
}

代码示例来源:origin: sd4324530/fastweixin

public void removeHandle(final ApiConfigChangeHandle handle) {
  super.deleteObserver(handle);
}

代码示例来源:origin: stackoverflow.com

Observable observable = observables.get(notification);
if (observable!=null) {         
  observable.deleteObserver(observer);

代码示例来源:origin: com.bbossgroups.pdp/bboss-pdp-fastwx

/**
 * 移除配置变化监听器
 *
 * @param handle 监听器
 */
public void removeHandle(final ApiConfigChangeHandle handle) {
  super.deleteObserver(handle);
}

代码示例来源:origin: net.java.dev.glazedlists/glazedlists_java15

/**
 * Stop observing the specified <code>element</code>.
 *
 * @param element the observed element
 * @param listener the listener that was installed on the <code>element</code>
 *      in {@link #installListener(Object)}
 */
public void uninstallListener(E element, EventListener listener) {
  element.deleteObserver(this);
}

代码示例来源:origin: net.java.dev.glazedlists/glazedlists_java16

/**
 * Stop observing the specified <code>element</code>.
 *
 * @param element the observed element
 * @param listener the listener that was installed on the <code>element</code>
 *      in {@link #installListener(Object)}
 */
@Override
public void uninstallListener(E element, EventListener listener) {
  element.deleteObserver(this);
}

代码示例来源:origin: com.haulmont.thirdparty/glazedlists

/**
 * Stop observing the specified <code>element</code>.
 *
 * @param element the observed element
 * @param listener the listener that was installed on the <code>element</code>
 *      in {@link #installListener(Object)}
 */
public void uninstallListener(E element, EventListener listener) {
  element.deleteObserver(this);
}

代码示例来源:origin: com.bbossgroups.pdp/bboss-pdp-fastwx

public void removeHandle(final ApiConfigChangeHandle handle) {
  super.deleteObserver(handle);
}

代码示例来源:origin: jasonwyatt/Squeaky-Android

@Override
protected void onPause() {
  super.onPause();
  sObservable.deleteObserver(this);
}

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-jruby

@Override
  public Void executeWithService(final Observable service) {
    final Observer observer = handlerToObserver.get(handler);
    if (observer != null) {
      service.deleteObserver(observer);
      handlerToObserver.remove(handler);
    }
    return null;
  }
});

代码示例来源:origin: org.kill-bill.billing/killbill-platform-osgi-bundles-logger

@Override
  public Void executeWithService(final Observable service) {
    final Observer observer = handlerToObserver.get(handler);
    if (observer != null) {
      service.deleteObserver(observer);
      handlerToObserver.remove(handler);
    }
    return null;
  }
});

代码示例来源:origin: org.kill-bill.billing/killbill-platform-osgi-bundles-lib-killbill

@Override
  public Void executeWithService(final Observable service) {
    final Observer observer = handlerToObserver.get(handler);
    if (observer != null) {
      service.deleteObserver(observer);
      handlerToObserver.remove(handler);
    }
    return null;
  }
});

代码示例来源:origin: org.kill-bill.billing/killbill-osgi-bundles-lib-killbill

@Override
  public Void executeWithService(final Observable service) {
    final Observer observer = handlerToObserver.get(handler);
    if (observer != null) {
      service.deleteObserver(observer);
      handlerToObserver.remove(handler);
    }
    return null;
  }
});

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

@Override
  public Void executeWithService(final Observable service) {
    final Observer observer = handlerToObserver.get(handler);
    if (observer != null) {
      service.deleteObserver(observer);
      handlerToObserver.remove(handler);
    }
    return null;
  }
});

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-analytics

@Override
  public Void executeWithService(final Observable service) {
    final Observer observer = handlerToObserver.get(handler);
    if (observer != null) {
      service.deleteObserver(observer);
      handlerToObserver.remove(handler);
    }
    return null;
  }
});

代码示例来源:origin: org.kill-bill.billing/killbill-platform-osgi-bundles-logger

@Override
  public Void executeWithService(final Observable service) {
    // Go through all known handlers (OSGIFrameworkEventHandler and OSGIKillbillEventHandler)
    // and remove them from the list of Observers
    for (final Object handler : handlerToObserver.keySet()) {
      final Observer observer = handlerToObserver.get(handler);
      if (observer != null) {
        service.deleteObserver(observer);
      }
    }
    handlerToObserver.clear();
    return null;
  }
});

代码示例来源:origin: io.snappydata/gemfirexd

public void update(Observable obj, Object arg) {
  if (SanityManager.DEBUG) {
    if (arg == null)
      SanityManager.THROWASSERT("still on observr list " + this);
  }
  if (arg.equals(RawTransaction.COMMIT)) {
    openContainerAndDoIt((RawTransaction) obj);
  }
  // remove this object if we are commiting, aborting or the container is being dropped
  if (arg.equals(RawTransaction.COMMIT) || arg.equals(RawTransaction.ABORT)
    || arg.equals(identity)) {
    obj.deleteObserver(this);
  }
}

代码示例来源:origin: org.onap.ccsdk.sli.core/dblib-provider

@Override
public void deleteObserver(Observer observer) {
  super.deleteObserver(observer);
  if (observer instanceof DBResourceObserver) {
    DBResourceObserver dbObserver = (DBResourceObserver) observer;
    if (dbObserver.isMonitorDbResponse() && countObservers() == 0) {
      timer.cancel();
      activeState = false;
    }
  }
}

代码示例来源:origin: priiduneemre/btcd-cli4j

@Override
public synchronized void update(Observable worker, Object result) {
  LOG.info(">> update(..): worker finished, informing listener(s) of new '{}' notification: "
      + "'{}'", type.name(), result);
  worker.deleteObserver(this);
  setChanged();
  notifyObservers(result);
}

代码示例来源:origin: org.fujion/fujion-core

@Override
public void setModel(M model) {
  if (this.model instanceof Observable) {
    ((Observable) this.model).deleteObserver(this);
  }
  this.model = model;
  modelChanged(null);
  targetChanged(null);
  if (this.model instanceof Observable) {
    ((Observable) this.model).addObserver(this);
  }
}

相关文章