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