コード例 #1
0
    @Override
    public void attributes(final Map<String, ?> newAttributes) {
      super.attributes(newAttributes);

      synchronized (ConcurrentServiceWatcher.this) {
        if (null != currentExport && thisImport.equals(currentImport)) {
          currentExport.attributes(newAttributes);
        }

        // has ranking changed?
        updateBestService();
      }
    }
コード例 #2
0
    @Override
    @SuppressWarnings("unchecked")
    public void put(final T newInstance) {
      super.put(newInstance);

      synchronized (ConcurrentServiceWatcher.this) {
        if (null != currentExport && thisImport.equals(currentImport)) {
          currentExport.put((S) newInstance);

          // is this being removed?
          if (null == newInstance) {
            updateBestService();
          }
        }
      }
    }