@Test public void addObserver() throws Throwable { MockAbstractThreadedPlugin plugin = new MockAbstractThreadedPlugin("addObserverTest"); plugin.addObserver(getOneObserver()); Assert.assertEquals(1, plugin.countObservers()); Assert.assertTrue(plugin.isMonitoring()); plugin.finalize(); }
@Override public final void addObserver(final ObservablePlugin.PluginObserver observer) { super.addObserver(observer); if (countObservers() == 1) { if (logger.isDebugEnabled()) { logger.debug("Start monitoring the plugin {}", this.getName()); } thread = new EventThread(this.getName()); thread.start(); } }
AbstractThreadedObservablePlugin extends AbstractObservablePlugin { @Override public final void addObserver(final ObservablePlugin.PluginObserver observer) { super.addObserver(observer); if (countObservers() == 1) { if (logger.isDebugEnabled()) { logger.debug("Start monitoring the plugin {}", this.getName()); } thread = new EventThread(this.getName()); thread.start(); } } }
AbstractThreadedObservablePlugin extends AbstractObservablePlugin { @Override public final void addObserver(final ObservablePlugin.PluginObserver observer) { super.addObserver(observer); if (countObservers() == 1) { if (logger.isDebugEnabled()) { logger.debug("Start monitoring the plugin {}", this.getName()); } thread = new EventThread(this.getName()); thread.start(); } } protected  AbstractThreadedObservablePlugin(String name); }
AbstractThreadedObservablePlugin extends AbstractObservablePlugin { @Override public final void addObserver(final ObservablePlugin.PluginObserver observer) { super.addObserver(observer); if (countObservers() == 1) { if (logger.isDebugEnabled()) { logger.debug("Start monitoring the plugin {}", this.getName()); } thread = new EventThread(this.getName()); thread.start(); } } protected  AbstractThreadedObservablePlugin(String name); @Override final void addObserver(final ObservablePlugin.PluginObserver observer); @Override final void removeObserver(final ObservablePlugin.PluginObserver observer); @Override final void clearObservers(); }
AbstractThreadedObservablePlugin extends AbstractObservablePlugin { @Override public final void addObserver(final ObservablePlugin.PluginObserver observer) { super.addObserver(observer); if (countObservers() == 1) { if (logger.isDebugEnabled()) { logger.debug("Start monitoring the plugin {}", this.getName()); } thread = new EventThread(this.getName()); thread.start(); } } protected  AbstractThreadedObservablePlugin(String name); @Override final void addObserver(final ObservablePlugin.PluginObserver observer); @Override final void removeObserver(final ObservablePlugin.PluginObserver observer); @Override final void clearObservers();  }