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