コード例 #1
0
  /** {@inheritDoc} */
  public void allBindingsChanged(BindingProvider provider) {
    super.allBindingsChanged(provider);

    if (bindingsExist()) {
      activeService.activate();
    } else {
      activeService.deactivate();
    }
  }
コード例 #2
0
  /** {@inheritDoc} */
  public void bindingChanged(BindingProvider provider, String itemName) {
    super.bindingChanged(provider, itemName);

    if (bindingsExist()) {
      activeService.activate();
    } else {
      activeService.deactivate();
    }
  }
コード例 #3
0
 /** @{inheritDoc} */
 @Override
 public void interrupt() {
   if (!bindingsExist()) {
     super.interrupt();
   } else {
     logger.trace("{} won't be interrupted because bindings exist.", getName());
   }
 }
コード例 #4
0
  /**
   * Removes <code>provider</code> from the list of providers. If there is no provider left the
   * refresh thread is getting interrupted.
   *
   * @param provider the {@link BindingProvider} to remove
   */
  public void removeBindingProvider(P provider) {
    super.removeBindingProvider(provider);

    // if there are no binding providers there is no need to run this
    // refresh thread any longer ...
    if (this.providers.size() == 0) {
      activeService.deactivate();
    }
  }
コード例 #5
0
 /**
  * @return <code>true</code> if this binding is configured properly which means that all necessary
  *     data is available
  */
 protected boolean isProperlyConfigured() {
   return activeService.isProperlyConfigured();
 }
コード例 #6
0
 /**
  * Used to define whether this binding is fully configured so that it can be activated and used.
  * Note that the implementation will automatically start the active service if <code>true</code>
  * is passed as a parameter and there are binding providers available.
  *
  * @param properlyConfigured
  */
 protected void setProperlyConfigured(boolean properlyConfigured) {
   if (providers.size() > 0) {
     activeService.setProperlyConfigured(properlyConfigured);
   }
 }
コード例 #7
0
 /**
  * Adds <code>provider</code> to the list of {@link BindingProvider}s and adds <code>this</code>
  * as {@link BindingChangeListener}. If <code>provider</code> contains any binding an the
  * refresh-Thread is stopped it will be started.
  *
  * @param provider the new {@link BindingProvider} to add
  */
 public void addBindingProvider(P provider) {
   super.addBindingProvider(provider);
   activeService.activate();
 }
コード例 #8
0
 /** {@inheritDoc} */
 @Override
 protected void start() {
   super.start();
 }