예제 #1
0
 /** Restart scheduler if some binding changes. */
 @Override
 public void bindingChanged(BindingProvider provider, String itemName) {
   if (context.getConfig().isValid()) {
     if (provider instanceof WeatherBindingProvider) {
       context.getJobScheduler().restart();
     }
   }
   super.bindingChanged(provider, itemName);
 }
예제 #2
0
  /* (non-Javadoc)
   * @see org.openhab.core.binding.AbstractBinding#deactivate()
   */
  public void deactivate() {
    super.deactivate();

    logger.debug("eBus binding has been stopped.");

    if (connector != null && connector.isAlive()) {
      connector.interrupt();
      connector = null;
    }

    if (commandProcessor != null) {
      commandProcessor.deactivate();
      commandProcessor = null;
    }
  }
예제 #3
0
  /* (non-Javadoc)
   * @see org.openhab.core.binding.AbstractBinding#addBindingProvider(org.openhab.core.binding.BindingProvider)
   */
  @Override
  public void addBindingProvider(EBusBindingProvider provider) {
    super.addBindingProvider(provider);

    if (commandProcessor == null) {
      commandProcessor = new EBusCommandProcessor();
      commandProcessor.setConfigurationProvider(configurationProvider);
    }

    if (provider.providesBinding()) {
      // items already processed, so too late for this listener. do it manually
      commandProcessor.allBindingsChanged(provider);
    }

    provider.addBindingChangeListener(commandProcessor);
  }
예제 #4
0
  /* (non-Javadoc)
   * @see org.openhab.core.binding.AbstractBinding#activate()
   */
  public void activate() {
    super.activate();
    logger.debug("eBus binding has been started.");

    // check to ensure that it is available
    checkConfigurationProvider();

    // observe connection, if not started 15 sec. later than start it manually
    // replacing a bundle doesn't recall update function, more
    // a bug/enhancement in openhab
    new Thread() {
      @Override
      public void run() {

        try {
          sleep(15000);

          if (connector == null) {
            logger.warn("eBus connector still not started, started it yet!");

            Configuration configuration =
                configurationAdminService.getConfiguration("org.openhab.ebus", null);
            if (configuration != null) {
              updated(configuration.getProperties());

              for (EBusBindingProvider provider : EBusBinding.this.providers) {
                commandProcessor.allBindingsChanged(provider);
              }
            }
          }

        } catch (InterruptedException e) {
          logger.error(e.toString(), e);
        } catch (ConfigurationException e) {
          logger.error(e.toString(), e);
        } catch (IOException e) {
          logger.error(e.toString(), e);
        }
      }
    }.start();
    ;
  }
예제 #5
0
 protected void removeBindingProvider(PanasonicTVBindingProvider bindingProvider) {
   super.removeBindingProvider(bindingProvider);
 }
예제 #6
0
 protected void addBindingProvider(PanasonicTVBindingProvider bindingProvider) {
   super.addBindingProvider(bindingProvider);
 }
예제 #7
0
 protected void removeBindingProvider(Ipx800BindingProvider bindingProvider) {
   super.removeBindingProvider(bindingProvider);
 }
예제 #8
0
 protected void addBindingProvider(Ipx800BindingProvider bindingProvider) {
   super.addBindingProvider(bindingProvider);
 }
예제 #9
0
 protected void removeBindingProvider(AsteriskBindingProvider bindingProvider) {
   super.removeBindingProvider(bindingProvider);
 }
예제 #10
0
 protected void addBindingProvider(XplBindingProvider bindingProvider) {
   super.addBindingProvider(bindingProvider);
 }
예제 #11
0
 /** Set EventPublisher in WeatherContext. */
 @Override
 public void setEventPublisher(EventPublisher eventPublisher) {
   super.setEventPublisher(eventPublisher);
   context.setEventPublisher(eventPublisher);
 }
예제 #12
0
 protected void addBindingProvider(OmniLinkBindingProvider bindingProvider) {
   super.addBindingProvider(bindingProvider);
 }
예제 #13
0
 /* (non-Javadoc)
  * @see org.openhab.core.binding.AbstractBinding#removeBindingProvider(org.openhab.core.binding.BindingProvider)
  */
 @Override
 public void removeBindingProvider(EBusBindingProvider provider) {
   super.removeBindingProvider(provider);
   provider.removeBindingChangeListener(commandProcessor);
 }
예제 #14
0
 protected void removeBindingProvider(XplBindingProvider bindingProvider) {
   super.removeBindingProvider(bindingProvider);
 }
예제 #15
0
 protected void addBindingProvider(HarmonyHubBindingProvider bindingProvider) {
   super.addBindingProvider(bindingProvider);
 }
예제 #16
0
 protected void removeBindingProvider(HarmonyHubBindingProvider bindingProvider) {
   super.removeBindingProvider(bindingProvider);
 }
예제 #17
0
 protected void removeBindingProvider(OmniLinkBindingProvider bindingProvider) {
   super.removeBindingProvider(bindingProvider);
 }
예제 #18
0
 protected void addBindingProvider(AsteriskBindingProvider bindingProvider) {
   super.addBindingProvider(bindingProvider);
 }
예제 #19
0
 /** {@inheritDoc} */
 public void bindingChanged(BindingProvider provider, String itemName) {
   super.bindingChanged(provider, itemName);
 }