Repository: incubator-unomi Updated Branches: refs/heads/feature-UNOMI-70-ES5X 35b939793 -> 2ff92868f
- Remove duplicate code - Add todo to properly use a service tracker/listener to watch for services appearing/disappearing. Signed-off-by: Serge Huber <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/incubator-unomi/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-unomi/commit/2ff92868 Tree: http://git-wip-us.apache.org/repos/asf/incubator-unomi/tree/2ff92868 Diff: http://git-wip-us.apache.org/repos/asf/incubator-unomi/diff/2ff92868 Branch: refs/heads/feature-UNOMI-70-ES5X Commit: 2ff92868f7b14f22233cbea9fa6af0fe9f7030e3 Parents: 35b9397 Author: Serge Huber <[email protected]> Authored: Wed Dec 21 22:20:55 2016 +0100 Committer: Serge Huber <[email protected]> Committed: Wed Dec 21 22:20:55 2016 +0100 ---------------------------------------------------------------------- .../ElasticSearchPersistenceServiceImpl.java | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-unomi/blob/2ff92868/persistence-elasticsearch/core/src/main/java/org/apache/unomi/persistence/elasticsearch/ElasticSearchPersistenceServiceImpl.java ---------------------------------------------------------------------- diff --git a/persistence-elasticsearch/core/src/main/java/org/apache/unomi/persistence/elasticsearch/ElasticSearchPersistenceServiceImpl.java b/persistence-elasticsearch/core/src/main/java/org/apache/unomi/persistence/elasticsearch/ElasticSearchPersistenceServiceImpl.java index dc909b9..f52dc5a 100644 --- a/persistence-elasticsearch/core/src/main/java/org/apache/unomi/persistence/elasticsearch/ElasticSearchPersistenceServiceImpl.java +++ b/persistence-elasticsearch/core/src/main/java/org/apache/unomi/persistence/elasticsearch/ElasticSearchPersistenceServiceImpl.java @@ -463,17 +463,6 @@ public class ElasticSearchPersistenceServiceImpl implements PersistenceService, if (existingBundle.getBundleContext() != null) { loadPredefinedMappings(existingBundle.getBundleContext(), true); } - if (existingBundle.getRegisteredServices() != null) { - for (ServiceReference<?> reference : existingBundle.getRegisteredServices()) { - Object service = bundleContext.getService(reference); - if (service instanceof ConditionEvaluator) { - conditionEvaluatorDispatcher.addEvaluator(reference.getProperty("conditionEvaluatorId").toString(), existingBundle.getBundleId(), (ConditionEvaluator) service); - } - if (service instanceof ConditionESQueryBuilder) { - conditionESQueryBuilderDispatcher.addQueryBuilder(reference.getProperty("queryBuilderId").toString(), existingBundle.getBundleId(), (ConditionESQueryBuilder) service); - } - } - } } logger.info(this.getClass().getName() + " service started successfully."); @@ -609,6 +598,7 @@ public class ElasticSearchPersistenceServiceImpl implements PersistenceService, public void bundleChanged(BundleEvent event) { switch (event.getType()) { case BundleEvent.STARTED: + // @todo replace this with a proper service tracker/listener if (event.getBundle() != null && event.getBundle().getRegisteredServices() != null) { for (ServiceReference<?> reference : event.getBundle().getRegisteredServices()) { Object service = bundleContext.getService(reference);
