@Override
  public void start() {
    // create data repositories
    Map<DataSource, DataRepository> sources = new HashMap<>();
    for (DataSource source : dataSourceRepository.getAll()) {
      sources.put(source, createDataRepository(source));
    }

    // start filter chains
    processorChainManager.startAllProcessorChains(sources);
  }
  public void remove(DataSource source) {
    Assert.assertNotNull(source);

    // delete source
    dataSourceRepository.remove(source);

    // delete source db
    dataRepositoryCache.remove(source.getId());
    processorChainManager.removeAll(source);
    dataViewManager.removeAll(source);
    notificationManager.removeAll(source);
    dbConnectorFactory.deleteDatabase(source.getId());
  }
 @Override
 public void stop() {
   processorChainManager.stopAllProcessorChains();
 }