3f47ed
From d7a2d969b55ab34a223ad1422b2e3ef7d95a347f Mon Sep 17 00:00:00 2001
3f47ed
From: Marian Koncek <mkoncek@redhat.com>
3f47ed
Date: Mon, 5 Nov 2018 09:59:04 +0100
3f47ed
Subject: [PATCH] Port to osgi-cmpn
3f47ed
3f47ed
---
3f47ed
 .../utils/repository/AggregateRepository.java | 20 +++++++++++++++++++
3f47ed
 .../utils/repository/BaseRepository.java      | 19 ++++++++++++++++++
3f47ed
 .../utils/properties/MockBundleContext.java   | 10 ++++++++++
3f47ed
 3 files changed, 49 insertions(+)
3f47ed
3f47ed
diff --git a/src/main/java/org/apache/felix/utils/repository/AggregateRepository.java b/src/main/java/org/apache/felix/utils/repository/AggregateRepository.java
3f47ed
index 50dceaf..4da3141 100644
3f47ed
--- a/src/main/java/org/apache/felix/utils/repository/AggregateRepository.java
3f47ed
+++ b/src/main/java/org/apache/felix/utils/repository/AggregateRepository.java
3f47ed
@@ -25,7 +25,12 @@ import java.util.Map;
3f47ed
 
3f47ed
 import org.osgi.resource.Capability;
3f47ed
 import org.osgi.resource.Requirement;
3f47ed
+import org.osgi.resource.Resource;
3f47ed
+import org.osgi.service.repository.ExpressionCombiner;
3f47ed
 import org.osgi.service.repository.Repository;
3f47ed
+import org.osgi.service.repository.RequirementBuilder;
3f47ed
+import org.osgi.service.repository.RequirementExpression;
3f47ed
+import org.osgi.util.promise.Promise;
3f47ed
 
3f47ed
 public class AggregateRepository implements Repository {
3f47ed
 
3f47ed
@@ -52,4 +57,19 @@ public class AggregateRepository implements Repository {
3f47ed
         }
3f47ed
         return result;
3f47ed
     }
3f47ed
+
3f47ed
+	@Override
3f47ed
+	public Promise<Collection<Resource>> findProviders(RequirementExpression expression) {
3f47ed
+		throw new UnsupportedOperationException();
3f47ed
+	}
3f47ed
+
3f47ed
+	@Override
3f47ed
+	public ExpressionCombiner getExpressionCombiner() {
3f47ed
+		throw new UnsupportedOperationException();
3f47ed
+	}
3f47ed
+
3f47ed
+	@Override
3f47ed
+	public RequirementBuilder newRequirementBuilder(String namespace) {
3f47ed
+		throw new UnsupportedOperationException();
3f47ed
+	}
3f47ed
 }
3f47ed
diff --git a/src/main/java/org/apache/felix/utils/repository/BaseRepository.java b/src/main/java/org/apache/felix/utils/repository/BaseRepository.java
3f47ed
index 95adadd..0998ab0 100644
3f47ed
--- a/src/main/java/org/apache/felix/utils/repository/BaseRepository.java
3f47ed
+++ b/src/main/java/org/apache/felix/utils/repository/BaseRepository.java
3f47ed
@@ -30,7 +30,11 @@ import org.osgi.framework.Constants;
3f47ed
 import org.osgi.resource.Capability;
3f47ed
 import org.osgi.resource.Requirement;
3f47ed
 import org.osgi.resource.Resource;
3f47ed
+import org.osgi.service.repository.ExpressionCombiner;
3f47ed
 import org.osgi.service.repository.Repository;
3f47ed
+import org.osgi.service.repository.RequirementBuilder;
3f47ed
+import org.osgi.service.repository.RequirementExpression;
3f47ed
+import org.osgi.util.promise.Promise;
3f47ed
 
3f47ed
 /**
3f47ed
  */
3f47ed
@@ -90,4 +94,19 @@ public class BaseRepository implements Repository {
3f47ed
         }
3f47ed
         return result;
3f47ed
     }
3f47ed
+
3f47ed
+	@Override
3f47ed
+	public Promise<Collection<Resource>> findProviders(RequirementExpression expression) {
3f47ed
+		throw new UnsupportedOperationException();
3f47ed
+	}
3f47ed
+
3f47ed
+	@Override
3f47ed
+	public ExpressionCombiner getExpressionCombiner() {
3f47ed
+		throw new UnsupportedOperationException();
3f47ed
+	}
3f47ed
+
3f47ed
+	@Override
3f47ed
+	public RequirementBuilder newRequirementBuilder(String namespace) {
3f47ed
+		throw new UnsupportedOperationException();
3f47ed
+	}
3f47ed
 }
3f47ed
diff --git a/src/test/java/org/apache/felix/utils/properties/MockBundleContext.java b/src/test/java/org/apache/felix/utils/properties/MockBundleContext.java
3f47ed
index 3eab444..df94a6c 100644
3f47ed
--- a/src/test/java/org/apache/felix/utils/properties/MockBundleContext.java
3f47ed
+++ b/src/test/java/org/apache/felix/utils/properties/MockBundleContext.java
3f47ed
@@ -25,7 +25,9 @@ import org.osgi.framework.BundleListener;
3f47ed
 import org.osgi.framework.Filter;
3f47ed
 import org.osgi.framework.FrameworkListener;
3f47ed
 import org.osgi.framework.InvalidSyntaxException;
3f47ed
+import org.osgi.framework.ServiceFactory;
3f47ed
 import org.osgi.framework.ServiceListener;
3f47ed
+import org.osgi.framework.ServiceObjects;
3f47ed
 import org.osgi.framework.ServiceReference;
3f47ed
 import org.osgi.framework.ServiceRegistration;
3f47ed
 
3f47ed
@@ -105,6 +107,10 @@ public class MockBundleContext implements BundleContext {
3f47ed
         throw new UnsupportedOperationException();
3f47ed
     }
3f47ed
 
3f47ed
+    public <S> ServiceRegistration<S> registerService(Class<S> clazz, ServiceFactory<S> factory, Dictionary<String, ?> properties) {
3f47ed
+        throw new UnsupportedOperationException();
3f47ed
+    }
3f47ed
+
3f47ed
     public ServiceReference[] getServiceReferences(String s, String s1) throws InvalidSyntaxException {
3f47ed
         throw new UnsupportedOperationException();
3f47ed
     }
3f47ed
@@ -125,6 +131,10 @@ public class MockBundleContext implements BundleContext {
3f47ed
         throw new UnsupportedOperationException();
3f47ed
     }
3f47ed
 
3f47ed
+	public <S> ServiceObjects<S> getServiceObjects(ServiceReference<S> reference) {
3f47ed
+	    throw new UnsupportedOperationException();
3f47ed
+	}
3f47ed
+
3f47ed
     public File getDataFile(String s) {
3f47ed
         throw new UnsupportedOperationException();
3f47ed
     }
3f47ed
-- 
3f47ed
2.17.2
3f47ed