a16fbef
From bfeef908b83862b6364dfcc856a26caf3be1765e Mon Sep 17 00:00:00 2001
a05b85b
From: Michael Simacek <msimacek@redhat.com>
a05b85b
Date: Thu, 26 May 2016 16:57:46 +0200
a16fbef
Subject: [PATCH 2/3] Remove unavailable parts
a05b85b
a05b85b
---
a05b85b
 biz.aQute.bnd/src/aQute/bnd/main/bnd.java          | 30 -----------------
a05b85b
 biz.aQute.bndlib/src/aQute/bnd/build/Project.java  |  4 +--
a05b85b
 .../src/aQute/bnd/component/AnnotationReader.java  | 38 ++++++++--------------
a05b85b
 .../src/aQute/bnd/component/ComponentDef.java      |  1 -
a05b85b
 .../src/aQute/bnd/component/FieldOption.java       |  5 +++
a05b85b
 .../src/aQute/bnd/component/HeaderReader.java      |  1 -
a05b85b
 .../src/aQute/bnd/component/ReferenceDef.java      |  2 --
a05b85b
 .../src/aQute/bnd/component/ReferenceScope.java    | 13 ++++++++
a05b85b
 .../src/aQute/bnd/component/ServiceScope.java      | 14 ++++++++
a05b85b
 .../src/aQute/bnd/http/HttpRequest.java            | 23 -------------
a05b85b
 .../src/aQute/bnd/obr/OBRFragment.java             | 22 ++++++-------
a05b85b
 biz.aQute.bndlib/src/aQute/bnd/osgi/Builder.java   |  3 --
a05b85b
 biz.aQute.bndlib/src/aQute/bnd/osgi/Contracts.java | 18 +++++-----
a05b85b
 .../src/aQute/bnd/osgi/resource/CapReqBuilder.java | 12 +++----
a05b85b
 .../src/aQute/bnd/osgi/resource/ResourceUtils.java | 18 ++++------
a05b85b
 15 files changed, 76 insertions(+), 128 deletions(-)
a05b85b
 create mode 100644 biz.aQute.bndlib/src/aQute/bnd/component/FieldOption.java
a05b85b
 create mode 100644 biz.aQute.bndlib/src/aQute/bnd/component/ReferenceScope.java
a05b85b
 create mode 100644 biz.aQute.bndlib/src/aQute/bnd/component/ServiceScope.java
a05b85b
a05b85b
diff --git a/biz.aQute.bnd/src/aQute/bnd/main/bnd.java b/biz.aQute.bnd/src/aQute/bnd/main/bnd.java
a05b85b
index 0a7affe..512d58f 100644
a05b85b
--- a/biz.aQute.bnd/src/aQute/bnd/main/bnd.java
a05b85b
+++ b/biz.aQute.bnd/src/aQute/bnd/main/bnd.java
a05b85b
@@ -4124,36 +4124,6 @@ public class bnd extends Processor {
a05b85b
 	}
a05b85b
 
a05b85b
 	/**
a05b85b
-	 * Resolve command
a05b85b
-	 * 
a05b85b
-	 * @throws Exception
a05b85b
-	 */
a05b85b
-
a05b85b
-	public void _resolve(ResolveCommand.ResolveOptions options) throws Exception {
a05b85b
-		ResolveCommand rc = new ResolveCommand(this);
a05b85b
-		String help = options._command().subCmd(options, rc);
a05b85b
-		if (help != null)
a05b85b
-			out.println(help);
a05b85b
-		getInfo(rc);
a05b85b
-		rc.close();
a05b85b
-	}
a05b85b
-
a05b85b
-	/**
a05b85b
-	 * Remote command
a05b85b
-	 * 
a05b85b
-	 * @throws Exception
a05b85b
-	 */
a05b85b
-
a05b85b
-	public void _remote(RemoteCommand.RemoteOptions options) throws Exception {
a05b85b
-		RemoteCommand rc = new RemoteCommand(this, options);
a05b85b
-		String help = options._command().subCmd(options, rc);
a05b85b
-		if (help != null)
a05b85b
-			out.println(help);
a05b85b
-		getInfo(rc);
a05b85b
-		rc.close();
a05b85b
-	}
a05b85b
-
a05b85b
-	/**
a05b85b
 	 * Export a bndrun file
a05b85b
 	 */
a05b85b
 
a05b85b
diff --git a/biz.aQute.bndlib/src/aQute/bnd/build/Project.java b/biz.aQute.bndlib/src/aQute/bnd/build/Project.java
a05b85b
index b0740f1..8ad8831 100644
a05b85b
--- a/biz.aQute.bndlib/src/aQute/bnd/build/Project.java
a05b85b
+++ b/biz.aQute.bndlib/src/aQute/bnd/build/Project.java
a05b85b
@@ -43,8 +43,6 @@ import java.util.regex.Pattern;
a05b85b
 import org.osgi.framework.namespace.IdentityNamespace;
a05b85b
 import org.osgi.resource.Capability;
a05b85b
 import org.osgi.resource.Requirement;
a05b85b
-import org.osgi.service.repository.ContentNamespace;
a05b85b
-import org.osgi.service.repository.Repository;
a05b85b
 
a05b85b
 import aQute.bnd.build.Container.TYPE;
a05b85b
 import aQute.bnd.header.Attrs;
a05b85b
@@ -1341,6 +1339,7 @@ public class Project extends Processor {
a05b85b
 
a05b85b
 			// If not, and if the repository implements the OSGi Repository
a05b85b
 			// Service, use a capability search on the osgi.content namespace.
a05b85b
+                        /*
a05b85b
 			if (result == null && plugin instanceof Repository) {
a05b85b
 				Repository repo = (Repository) plugin;
a05b85b
 
a05b85b
@@ -1373,6 +1372,7 @@ public class Project extends Processor {
a05b85b
 					result = plugin.get(id, bndVersion, null, blocker);
a05b85b
 				}
a05b85b
 			}
a05b85b
+                        */
a05b85b
 
a05b85b
 			if (result != null)
a05b85b
 				return toContainer(bsn, "hash", attrs, result, blocker);
a05b85b
diff --git a/biz.aQute.bndlib/src/aQute/bnd/component/AnnotationReader.java b/biz.aQute.bndlib/src/aQute/bnd/component/AnnotationReader.java
a05b85b
index 28d13ac..2a890fc 100644
a05b85b
--- a/biz.aQute.bndlib/src/aQute/bnd/component/AnnotationReader.java
a05b85b
+++ b/biz.aQute.bndlib/src/aQute/bnd/component/AnnotationReader.java
a05b85b
@@ -14,16 +14,11 @@ import java.util.regex.Pattern;
a05b85b
 
a05b85b
 import org.osgi.service.component.annotations.Activate;
a05b85b
 import org.osgi.service.component.annotations.Component;
a05b85b
-import org.osgi.service.component.annotations.ConfigurationPolicy;
a05b85b
 import org.osgi.service.component.annotations.Deactivate;
a05b85b
-import org.osgi.service.component.annotations.FieldOption;
a05b85b
 import org.osgi.service.component.annotations.Modified;
a05b85b
 import org.osgi.service.component.annotations.Reference;
a05b85b
 import org.osgi.service.component.annotations.ReferenceCardinality;
a05b85b
 import org.osgi.service.component.annotations.ReferencePolicy;
a05b85b
-import org.osgi.service.component.annotations.ReferenceScope;
a05b85b
-import org.osgi.service.component.annotations.ServiceScope;
a05b85b
-import org.osgi.service.metatype.annotations.Designate;
a05b85b
 
a05b85b
 import aQute.bnd.annotation.xml.XMLAttribute;
a05b85b
 import aQute.bnd.component.DSAnnotations.Options;
a05b85b
@@ -232,8 +227,6 @@ public class AnnotationReader extends ClassDataCollector {
a05b85b
 				doModified();
a05b85b
 			else if (a instanceof Reference)
a05b85b
 				doReference((Reference) a, annotation);
a05b85b
-			else if (a instanceof Designate)
a05b85b
-				doDesignate((Designate) a);
a05b85b
 			else if (annotation.getName().getFQN().startsWith("aQute.bnd.annotation.component"))
a05b85b
 				handleMixedUsageError(annotation);
a05b85b
 			else {
a05b85b
@@ -290,11 +283,6 @@ public class AnnotationReader extends ClassDataCollector {
a05b85b
 		}
a05b85b
 	}
a05b85b
 
a05b85b
-	protected void doDesignate(Designate a) {
a05b85b
-		if (a.factory() && component.configurationPolicy == null)
a05b85b
-			component.configurationPolicy = ConfigurationPolicy.REQUIRE;
a05b85b
-	}
a05b85b
-
a05b85b
 	/**
a05b85b
 	 * 
a05b85b
 	 */
a05b85b
@@ -536,15 +524,15 @@ public class AnnotationReader extends ClassDataCollector {
a05b85b
 		}
a05b85b
 		def.className = className.getFQN();
a05b85b
 		def.name = reference.name();
a05b85b
-		def.bind = reference.bind();
a05b85b
+		def.bind = "";
a05b85b
 		def.unbind = reference.unbind();
a05b85b
 		def.updated = reference.updated();
a05b85b
-		def.field = reference.field();
a05b85b
-		def.fieldOption = reference.fieldOption();
a05b85b
+		def.field = "";
a05b85b
+		def.fieldOption = FieldOption.REPLACE;
a05b85b
 		def.cardinality = reference.cardinality();
a05b85b
 		def.policy = reference.policy();
a05b85b
 		def.policyOption = reference.policyOption();
a05b85b
-		def.scope = reference.scope();
a05b85b
+		def.scope = ReferenceScope.BUNDLE;
a05b85b
 
a05b85b
 		// Check if we have a target, this must be a filter
a05b85b
 		def.target = reference.target();
a05b85b
@@ -857,17 +845,17 @@ public class AnnotationReader extends ClassDataCollector {
a05b85b
 			component.factory = comp.factory();
a05b85b
 		if (annotation.get("immediate") != null)
a05b85b
 			component.immediate = comp.immediate();
a05b85b
-		if (annotation.get("servicefactory") != null)
a05b85b
-			component.scope = comp.servicefactory() ? ServiceScope.BUNDLE : ServiceScope.SINGLETON;
a05b85b
-		if (annotation.get("scope") != null && comp.scope() != ServiceScope.DEFAULT) {
a05b85b
-			component.scope = comp.scope();
a05b85b
-			if (comp.scope() == ServiceScope.PROTOTYPE) {
a05b85b
-				component.updateVersion(V1_3);
a05b85b
-			}
a05b85b
-		}
a05b85b
+//		if (annotation.get("servicefactory") != null)
a05b85b
+//			component.scope = comp.servicefactory() ? ServiceScope.BUNDLE : ServiceScope.SINGLETON;
a05b85b
+//		if (annotation.get("scope") != null && comp.scope() != ServiceScope.DEFAULT) {
a05b85b
+//			component.scope = comp.scope();
a05b85b
+//			if (comp.scope() == ServiceScope.PROTOTYPE) {
a05b85b
+//				component.updateVersion(V1_3);
a05b85b
+//			}
a05b85b
+//		}
a05b85b
 
a05b85b
 		if (annotation.get("configurationPid") != null) {
a05b85b
-			component.configurationPid = comp.configurationPid();
a05b85b
+			component.configurationPid = new String[] {comp.configurationPid()};
a05b85b
 			if (component.configurationPid.length > 1) {
a05b85b
 				component.updateVersion(V1_3);
a05b85b
 			} else {
a05b85b
diff --git a/biz.aQute.bndlib/src/aQute/bnd/component/ComponentDef.java b/biz.aQute.bndlib/src/aQute/bnd/component/ComponentDef.java
a05b85b
index 38309fe..ba53142 100644
a05b85b
--- a/biz.aQute.bndlib/src/aQute/bnd/component/ComponentDef.java
a05b85b
+++ b/biz.aQute.bndlib/src/aQute/bnd/component/ComponentDef.java
a05b85b
@@ -9,7 +9,6 @@ import java.util.Map;
a05b85b
 import java.util.TreeMap;
a05b85b
 
a05b85b
 import org.osgi.service.component.annotations.ConfigurationPolicy;
a05b85b
-import org.osgi.service.component.annotations.ServiceScope;
a05b85b
 
a05b85b
 import aQute.bnd.osgi.Analyzer;
a05b85b
 import aQute.bnd.osgi.Descriptors.TypeRef;
a05b85b
diff --git a/biz.aQute.bndlib/src/aQute/bnd/component/FieldOption.java b/biz.aQute.bndlib/src/aQute/bnd/component/FieldOption.java
a05b85b
new file mode 100644
a05b85b
index 0000000..4b65c12
a05b85b
--- /dev/null
a05b85b
+++ b/biz.aQute.bndlib/src/aQute/bnd/component/FieldOption.java
a05b85b
@@ -0,0 +1,5 @@
a05b85b
+package aQute.bnd.component;
a05b85b
+enum FieldOption {
a05b85b
+    UPDATE,
a05b85b
+    REPLACE
a05b85b
+}
a05b85b
diff --git a/biz.aQute.bndlib/src/aQute/bnd/component/HeaderReader.java b/biz.aQute.bndlib/src/aQute/bnd/component/HeaderReader.java
a05b85b
index 2a64e20..b070fbd 100644
a05b85b
--- a/biz.aQute.bndlib/src/aQute/bnd/component/HeaderReader.java
a05b85b
+++ b/biz.aQute.bndlib/src/aQute/bnd/component/HeaderReader.java
a05b85b
@@ -16,7 +16,6 @@ import org.osgi.service.component.annotations.ConfigurationPolicy;
a05b85b
 import org.osgi.service.component.annotations.ReferenceCardinality;
a05b85b
 import org.osgi.service.component.annotations.ReferencePolicy;
a05b85b
 import org.osgi.service.component.annotations.ReferencePolicyOption;
a05b85b
-import org.osgi.service.component.annotations.ServiceScope;
a05b85b
 
a05b85b
 import aQute.bnd.component.error.DeclarativeServicesAnnotationError;
a05b85b
 import aQute.bnd.component.error.DeclarativeServicesAnnotationError.ErrorType;
a05b85b
diff --git a/biz.aQute.bndlib/src/aQute/bnd/component/ReferenceDef.java b/biz.aQute.bndlib/src/aQute/bnd/component/ReferenceDef.java
a05b85b
index cc48f2d..d21d63b 100644
a05b85b
--- a/biz.aQute.bndlib/src/aQute/bnd/component/ReferenceDef.java
a05b85b
+++ b/biz.aQute.bndlib/src/aQute/bnd/component/ReferenceDef.java
a05b85b
@@ -1,10 +1,8 @@
a05b85b
 package aQute.bnd.component;
a05b85b
 
a05b85b
-import org.osgi.service.component.annotations.FieldOption;
a05b85b
 import org.osgi.service.component.annotations.ReferenceCardinality;
a05b85b
 import org.osgi.service.component.annotations.ReferencePolicy;
a05b85b
 import org.osgi.service.component.annotations.ReferencePolicyOption;
a05b85b
-import org.osgi.service.component.annotations.ReferenceScope;
a05b85b
 
a05b85b
 import aQute.bnd.osgi.Analyzer;
a05b85b
 import aQute.bnd.osgi.Verifier;
a05b85b
diff --git a/biz.aQute.bndlib/src/aQute/bnd/component/ReferenceScope.java b/biz.aQute.bndlib/src/aQute/bnd/component/ReferenceScope.java
a05b85b
new file mode 100644
a05b85b
index 0000000..70f2b78
a05b85b
--- /dev/null
a05b85b
+++ b/biz.aQute.bndlib/src/aQute/bnd/component/ReferenceScope.java
a05b85b
@@ -0,0 +1,13 @@
a05b85b
+package aQute.bnd.component;
a05b85b
+enum ReferenceScope {
a05b85b
+    BUNDLE("bundle"),
a05b85b
+    PROTOTYPE("prototype"),
a05b85b
+    PROTOTYPE_REQUIRED("prototype_required");
a05b85b
+    private final String value;
a05b85b
+    ReferenceScope(String value) {
a05b85b
+        this.value = value;
a05b85b
+    }
a05b85b
+    public String toString() {
a05b85b
+        return value;
a05b85b
+    }
a05b85b
+}
a05b85b
diff --git a/biz.aQute.bndlib/src/aQute/bnd/component/ServiceScope.java b/biz.aQute.bndlib/src/aQute/bnd/component/ServiceScope.java
a05b85b
new file mode 100644
a05b85b
index 0000000..aa49766
a05b85b
--- /dev/null
a05b85b
+++ b/biz.aQute.bndlib/src/aQute/bnd/component/ServiceScope.java
a05b85b
@@ -0,0 +1,14 @@
a05b85b
+package aQute.bnd.component;
a05b85b
+enum ServiceScope {
a05b85b
+    SINGLETON("singleton"),
a05b85b
+    BUNDLE("bundle"),
a05b85b
+    PROTOTYPE("prototype"),
a05b85b
+    DEFAULT("<<default>>");
a05b85b
+    private final String value;
a05b85b
+    ServiceScope(String value) {
a05b85b
+        this.value = value;
a05b85b
+    }
a05b85b
+    public String toString() {
a05b85b
+        return value;
a05b85b
+    }
a05b85b
+}
a05b85b
diff --git a/biz.aQute.bndlib/src/aQute/bnd/http/HttpRequest.java b/biz.aQute.bndlib/src/aQute/bnd/http/HttpRequest.java
a05b85b
index 8ab406f..2ed3278 100644
a05b85b
--- a/biz.aQute.bndlib/src/aQute/bnd/http/HttpRequest.java
a05b85b
+++ b/biz.aQute.bndlib/src/aQute/bnd/http/HttpRequest.java
a05b85b
@@ -9,9 +9,6 @@ import java.util.Map;
a05b85b
 import java.util.concurrent.Executor;
a05b85b
 import java.util.concurrent.TimeUnit;
a05b85b
 
a05b85b
-import org.osgi.util.promise.Deferred;
a05b85b
-import org.osgi.util.promise.Promise;
a05b85b
-
a05b85b
 import aQute.bnd.osgi.Processor;
a05b85b
 import aQute.bnd.service.url.TaggedData;
a05b85b
 import aQute.lib.converter.TypeReference;
a05b85b
@@ -196,26 +193,6 @@ public class HttpRequest<T> {
a05b85b
 		return this;
a05b85b
 	}
a05b85b
 
a05b85b
-	public Promise<T> async(final URL url) {
a05b85b
-		this.url = url;
a05b85b
-		final Deferred<T> deferred = new Deferred<>();
a05b85b
-		Executor e = Processor.getExecutor();
a05b85b
-		e.execute(new Runnable() {
a05b85b
-
a05b85b
-			@Override
a05b85b
-			public void run() {
a05b85b
-				try {
a05b85b
-					T result = (T) client.send(HttpRequest.this);
a05b85b
-					deferred.resolve(result);
a05b85b
-				} catch (Exception t) {
a05b85b
-					deferred.fail(t);
a05b85b
-				}
a05b85b
-			}
a05b85b
-
a05b85b
-		});
a05b85b
-		return deferred.getPromise();
a05b85b
-	}
a05b85b
-
a05b85b
 	@Override
a05b85b
 	public String toString() {
a05b85b
 		return "HttpRequest [verb=" + verb + ", upload=" + upload + ", download=" + download + ", headers=" + headers
a05b85b
diff --git a/biz.aQute.bndlib/src/aQute/bnd/obr/OBRFragment.java b/biz.aQute.bndlib/src/aQute/bnd/obr/OBRFragment.java
a05b85b
index 80cb5d2..ac0f70c 100644
a05b85b
--- a/biz.aQute.bndlib/src/aQute/bnd/obr/OBRFragment.java
a05b85b
+++ b/biz.aQute.bndlib/src/aQute/bnd/obr/OBRFragment.java
a05b85b
@@ -15,10 +15,8 @@ import org.osgi.framework.namespace.ExecutionEnvironmentNamespace;
a05b85b
 import org.osgi.framework.namespace.HostNamespace;
a05b85b
 import org.osgi.framework.namespace.IdentityNamespace;
a05b85b
 import org.osgi.framework.namespace.PackageNamespace;
a05b85b
-import org.osgi.namespace.service.ServiceNamespace;
a05b85b
 import org.osgi.resource.Capability;
a05b85b
 import org.osgi.resource.Namespace;
a05b85b
-import org.osgi.service.repository.ContentNamespace;
a05b85b
 
a05b85b
 import aQute.bnd.header.Attrs;
a05b85b
 import aQute.bnd.header.Parameters;
a05b85b
@@ -217,10 +215,10 @@ public class OBRFragment {
a05b85b
 			//
a05b85b
 
a05b85b
 			for (Entry<String,Attrs> export : d.getParameters(Constants.EXPORT_SERVICE).entrySet()) {
a05b85b
-				CapReqBuilder exportedService = new CapReqBuilder(ServiceNamespace.SERVICE_NAMESPACE);
a05b85b
+				CapReqBuilder exportedService = new CapReqBuilder("osgi.service");
a05b85b
 				String service = Processor.removeDuplicateMarker(export.getKey());
a05b85b
-				exportedService.addAttribute(ServiceNamespace.SERVICE_NAMESPACE, service);
a05b85b
-				exportedService.addAttribute(ServiceNamespace.CAPABILITY_OBJECTCLASS_ATTRIBUTE,
a05b85b
+				exportedService.addAttribute("osgi.service", service);
a05b85b
+				exportedService.addAttribute("objectClass",
a05b85b
 						export.getValue().get("objectclass"));
a05b85b
 				resource.addCapability(exportedService);
a05b85b
 			}
a05b85b
@@ -230,10 +228,10 @@ public class OBRFragment {
a05b85b
 			//
a05b85b
 
a05b85b
 			for (Entry<String,Attrs> imported : d.getParameters(Constants.IMPORT_SERVICE).entrySet()) {
a05b85b
-				CapReqBuilder importedService = new CapReqBuilder(ServiceNamespace.SERVICE_NAMESPACE);
a05b85b
+				CapReqBuilder importedService = new CapReqBuilder("osgi.service");
a05b85b
 				String service = Processor.removeDuplicateMarker(imported.getKey());
a05b85b
 				importedService.addDirective(Namespace.REQUIREMENT_FILTER_DIRECTIVE,
a05b85b
-						filter(ServiceNamespace.SERVICE_NAMESPACE, service, imported.getValue()));
a05b85b
+						filter("osgi.service", service, imported.getValue()));
a05b85b
 				resource.addRequirement(importedService);
a05b85b
 			}
a05b85b
 
a05b85b
@@ -276,16 +274,16 @@ public class OBRFragment {
a05b85b
 			if (!reporter.isOk())
a05b85b
 				return reporter;
a05b85b
 
a05b85b
-			CapReqBuilder content = new CapReqBuilder(ContentNamespace.CONTENT_NAMESPACE);
a05b85b
+			CapReqBuilder content = new CapReqBuilder("osgi.content");
a05b85b
 			String sha = SHA1.digest(file).asHex();
a05b85b
-			content.addAttribute(ContentNamespace.CONTENT_NAMESPACE, sha);
a05b85b
-			content.addAttribute(ContentNamespace.CAPABILITY_SIZE_ATTRIBUTE, (long) file.length());
a05b85b
-			content.addAttribute(ContentNamespace.CAPABILITY_MIME_ATTRIBUTE, MIME_TYPE_OSGI_BUNDLE);
a05b85b
+			content.addAttribute("osgi.content", sha);
a05b85b
+			content.addAttribute("size", (long) file.length());
a05b85b
+			content.addAttribute("mime", MIME_TYPE_OSGI_BUNDLE);
a05b85b
 
a05b85b
 			if (base != null) {
a05b85b
 				String path = file.getAbsolutePath();
a05b85b
 				if (base.startsWith(path)) {
a05b85b
-					content.addAttribute(ContentNamespace.CAPABILITY_URL_ATTRIBUTE,
a05b85b
+					content.addAttribute("url",
a05b85b
 							path.substring(base.length()).replace(File.separatorChar, '/'));
a05b85b
 				} else {
a05b85b
 					reporter.error("Base path %s is not parent of file path: %s", base, file.getAbsolutePath());
a05b85b
diff --git a/biz.aQute.bndlib/src/aQute/bnd/osgi/Builder.java b/biz.aQute.bndlib/src/aQute/bnd/osgi/Builder.java
a05b85b
index c61ae1f..aa5f386 100644
a05b85b
--- a/biz.aQute.bndlib/src/aQute/bnd/osgi/Builder.java
a05b85b
+++ b/biz.aQute.bndlib/src/aQute/bnd/osgi/Builder.java
a05b85b
@@ -35,7 +35,6 @@ import aQute.bnd.make.component.ServiceComponent;
a05b85b
 import aQute.bnd.make.metatype.MetatypePlugin;
a05b85b
 import aQute.bnd.maven.PomPropertiesResource;
a05b85b
 import aQute.bnd.maven.PomResource;
a05b85b
-import aQute.bnd.metatype.MetatypeAnnotations;
a05b85b
 import aQute.bnd.osgi.Descriptors.PackageRef;
a05b85b
 import aQute.bnd.osgi.Descriptors.TypeRef;
a05b85b
 import aQute.bnd.service.SignerPlugin;
a05b85b
@@ -1569,7 +1568,6 @@ public class Builder extends Analyzer {
a05b85b
 	static ServiceComponent		serviceComponent	= new ServiceComponent();
a05b85b
 	static DSAnnotations		dsAnnotations		= new DSAnnotations();
a05b85b
 	static MetatypePlugin		metatypePlugin		= new MetatypePlugin();
a05b85b
-	static MetatypeAnnotations	metatypeAnnotations	= new MetatypeAnnotations();
a05b85b
 
a05b85b
 	@Override
a05b85b
 	protected void setTypeSpecificPlugins(Set<Object> list) {
a05b85b
@@ -1578,7 +1576,6 @@ public class Builder extends Analyzer {
a05b85b
 		list.add(serviceComponent);
a05b85b
 		list.add(dsAnnotations);
a05b85b
 		list.add(metatypePlugin);
a05b85b
-		list.add(metatypeAnnotations);
a05b85b
 		super.setTypeSpecificPlugins(list);
a05b85b
 	}
a05b85b
 
a05b85b
diff --git a/biz.aQute.bndlib/src/aQute/bnd/osgi/Contracts.java b/biz.aQute.bndlib/src/aQute/bnd/osgi/Contracts.java
a05b85b
index bf0c8e4..6fda472 100644
a05b85b
--- a/biz.aQute.bndlib/src/aQute/bnd/osgi/Contracts.java
a05b85b
+++ b/biz.aQute.bndlib/src/aQute/bnd/osgi/Contracts.java
a05b85b
@@ -7,8 +7,6 @@ import java.util.List;
a05b85b
 import java.util.Map.Entry;
a05b85b
 import java.util.Set;
a05b85b
 
a05b85b
-import org.osgi.namespace.contract.ContractNamespace;
a05b85b
-
a05b85b
 import aQute.bnd.header.Attrs;
a05b85b
 import aQute.bnd.header.Parameters;
a05b85b
 import aQute.bnd.osgi.Descriptors.PackageRef;
a05b85b
@@ -73,13 +71,13 @@ class Contracts {
a05b85b
 		contract: for (Entry<String,Attrs> p : pcs.entrySet()) {
a05b85b
 			String namespace = p.getKey();
a05b85b
 
a05b85b
-			if (namespace.equals(ContractNamespace.CONTRACT_NAMESPACE)) {
a05b85b
+			if (namespace.equals("osgi.contract")) {
a05b85b
 				Attrs capabilityAttrs = p.getValue();
a05b85b
 
a05b85b
-				String name = capabilityAttrs.get(ContractNamespace.CONTRACT_NAMESPACE);
a05b85b
+				String name = capabilityAttrs.get("osgi.contract");
a05b85b
 				if (name == null) {
a05b85b
 					analyzer.warning("No name (attr %s) defined in bundle %s from contract namespace: %s",
a05b85b
-							ContractNamespace.CONTRACT_NAMESPACE, from, capabilityAttrs);
a05b85b
+							"osgi.contract", from, capabilityAttrs);
a05b85b
 					continue contract;
a05b85b
 				}
a05b85b
 
a05b85b
@@ -96,7 +94,7 @@ class Contracts {
a05b85b
 						Contract c = new Contract();
a05b85b
 						c.name = name;
a05b85b
 
a05b85b
-						String list = capabilityAttrs.get(ContractNamespace.CAPABILITY_USES_DIRECTIVE + ":");
a05b85b
+						String list = capabilityAttrs.get("uses" + ":");
a05b85b
 						if (list == null || list.length() == 0) {
a05b85b
 							analyzer.warning("Contract %s has no uses: directive in %s.", name, from);
a05b85b
 							continue contract; // next contract
a05b85b
@@ -104,7 +102,7 @@ class Contracts {
a05b85b
 
a05b85b
 						c.uses = Processor.split(list);
a05b85b
 
a05b85b
-						c.version = (Version) capabilityAttrs.getTyped(ContractNamespace.CAPABILITY_VERSION_ATTRIBUTE);
a05b85b
+						c.version = (Version) capabilityAttrs.getTyped("version");
a05b85b
 						c.from = from;
a05b85b
 
a05b85b
 						if (c.version == null) {
a05b85b
@@ -159,14 +157,14 @@ class Contracts {
a05b85b
 	void addToRequirements(Parameters requirements) {
a05b85b
 		for (Contract c : contracts) {
a05b85b
 			Attrs attrs = new Attrs(c.decorators);
a05b85b
-			attrs.put(ContractNamespace.CONTRACT_NAMESPACE, c.name);
a05b85b
-			String name = ContractNamespace.CONTRACT_NAMESPACE;
a05b85b
+			attrs.put("osgi.contract", c.name);
a05b85b
+			String name = "osgi.contract";
a05b85b
 			while (requirements.containsKey(name))
a05b85b
 				name += "~";
a05b85b
 
a05b85b
 			Formatter f = new Formatter();
a05b85b
 			try {
a05b85b
-				f.format("(&(%s=%s)(version=%s))", ContractNamespace.CONTRACT_NAMESPACE, c.name, c.version);
a05b85b
+				f.format("(&(%s=%s)(version=%s))", "osgi.contract", c.name, c.version);
a05b85b
 
a05b85b
 				// TODO : shall we also assert the attributes?
a05b85b
 
a05b85b
diff --git a/biz.aQute.bndlib/src/aQute/bnd/osgi/resource/CapReqBuilder.java b/biz.aQute.bndlib/src/aQute/bnd/osgi/resource/CapReqBuilder.java
a05b85b
index 251c762..bd9c7fb 100644
a05b85b
--- a/biz.aQute.bndlib/src/aQute/bnd/osgi/resource/CapReqBuilder.java
a05b85b
+++ b/biz.aQute.bndlib/src/aQute/bnd/osgi/resource/CapReqBuilder.java
a05b85b
@@ -17,14 +17,10 @@ import org.osgi.framework.namespace.ExecutionEnvironmentNamespace;
a05b85b
 import org.osgi.framework.namespace.HostNamespace;
a05b85b
 import org.osgi.framework.namespace.IdentityNamespace;
a05b85b
 import org.osgi.framework.namespace.PackageNamespace;
a05b85b
-import org.osgi.namespace.contract.ContractNamespace;
a05b85b
-import org.osgi.namespace.extender.ExtenderNamespace;
a05b85b
-import org.osgi.namespace.service.ServiceNamespace;
a05b85b
 import org.osgi.resource.Capability;
a05b85b
 import org.osgi.resource.Namespace;
a05b85b
 import org.osgi.resource.Requirement;
a05b85b
 import org.osgi.resource.Resource;
a05b85b
-import org.osgi.service.repository.ContentNamespace;
a05b85b
 
a05b85b
 import aQute.bnd.header.Attrs;
a05b85b
 import aQute.bnd.header.Parameters;
a05b85b
@@ -412,11 +408,11 @@ public class CapReqBuilder {
a05b85b
 	}
a05b85b
 
a05b85b
 	public boolean isService() {
a05b85b
-		return ServiceNamespace.SERVICE_NAMESPACE.equals(getNamespace());
a05b85b
+		return "osgi.service".equals(getNamespace());
a05b85b
 	}
a05b85b
 
a05b85b
 	public boolean isContract() {
a05b85b
-		return ContractNamespace.CONTRACT_NAMESPACE.equals(getNamespace());
a05b85b
+		return "osgi.contract".equals(getNamespace());
a05b85b
 	}
a05b85b
 
a05b85b
 	public boolean isIdentity() {
a05b85b
@@ -424,7 +420,7 @@ public class CapReqBuilder {
a05b85b
 	}
a05b85b
 
a05b85b
 	public boolean isContent() {
a05b85b
-		return ContentNamespace.CONTENT_NAMESPACE.equals(getNamespace());
a05b85b
+		return "osgi.content".equals(getNamespace());
a05b85b
 	}
a05b85b
 
a05b85b
 	public boolean isEE() {
a05b85b
@@ -432,7 +428,7 @@ public class CapReqBuilder {
a05b85b
 	}
a05b85b
 
a05b85b
 	public boolean isExtender() {
a05b85b
-		return ExtenderNamespace.EXTENDER_NAMESPACE.equals(getNamespace());
a05b85b
+		return "osgi.extender".equals(getNamespace());
a05b85b
 	}
a05b85b
 
a05b85b
 	public Attrs toAttrs() {
a05b85b
diff --git a/biz.aQute.bndlib/src/aQute/bnd/osgi/resource/ResourceUtils.java b/biz.aQute.bndlib/src/aQute/bnd/osgi/resource/ResourceUtils.java
a05b85b
index 05d9023..c90b42e 100644
a05b85b
--- a/biz.aQute.bndlib/src/aQute/bnd/osgi/resource/ResourceUtils.java
a05b85b
+++ b/biz.aQute.bndlib/src/aQute/bnd/osgi/resource/ResourceUtils.java
a05b85b
@@ -23,14 +23,10 @@ import org.osgi.framework.namespace.ExecutionEnvironmentNamespace;
a05b85b
 import org.osgi.framework.namespace.HostNamespace;
a05b85b
 import org.osgi.framework.namespace.IdentityNamespace;
a05b85b
 import org.osgi.framework.namespace.PackageNamespace;
a05b85b
-import org.osgi.namespace.contract.ContractNamespace;
a05b85b
-import org.osgi.namespace.extender.ExtenderNamespace;
a05b85b
-import org.osgi.namespace.service.ServiceNamespace;
a05b85b
 import org.osgi.resource.Capability;
a05b85b
 import org.osgi.resource.Namespace;
a05b85b
 import org.osgi.resource.Requirement;
a05b85b
 import org.osgi.resource.Resource;
a05b85b
-import org.osgi.service.repository.ContentNamespace;
a05b85b
 
a05b85b
 import aQute.bnd.header.Attrs;
a05b85b
 import aQute.bnd.version.Version;
a05b85b
@@ -182,7 +178,7 @@ public class ResourceUtils {
a05b85b
 	public static List<ContentCapability> getContentCapabilities(Resource resource) {
a05b85b
 		List<ContentCapability> result = new ArrayList<>();
a05b85b
 
a05b85b
-		for (Capability c : resource.getCapabilities(ContentNamespace.CONTENT_NAMESPACE)) {
a05b85b
+		for (Capability c : resource.getCapabilities("osgi.content")) {
a05b85b
 			result.add(as(c, ContentCapability.class));
a05b85b
 		}
a05b85b
 		return result;
a05b85b
@@ -244,7 +240,7 @@ public class ResourceUtils {
a05b85b
 	}
a05b85b
 
a05b85b
 	public static URI getURI(Capability contentCapability) {
a05b85b
-		Object uriObj = contentCapability.getAttributes().get(ContentNamespace.CAPABILITY_URL_ATTRIBUTE);
a05b85b
+		Object uriObj = contentCapability.getAttributes().get("url");
a05b85b
 		if (uriObj == null)
a05b85b
 			return null;
a05b85b
 
a05b85b
@@ -288,14 +284,14 @@ public class ResourceUtils {
a05b85b
 			name = HostNamespace.CAPABILITY_BUNDLE_VERSION_ATTRIBUTE;
a05b85b
 		else if (PackageNamespace.PACKAGE_NAMESPACE.equals(ns))
a05b85b
 			name = PackageNamespace.CAPABILITY_VERSION_ATTRIBUTE;
a05b85b
-		else if (ServiceNamespace.SERVICE_NAMESPACE.equals(ns))
a05b85b
+		else if ("osgi.service".equals(ns))
a05b85b
 			name = null;
a05b85b
 		else if (ExecutionEnvironmentNamespace.EXECUTION_ENVIRONMENT_NAMESPACE.equals(ns))
a05b85b
 			name = ExecutionEnvironmentNamespace.CAPABILITY_VERSION_ATTRIBUTE;
a05b85b
-		else if (ExtenderNamespace.EXTENDER_NAMESPACE.equals(ns))
a05b85b
-			name = ExtenderNamespace.CAPABILITY_VERSION_ATTRIBUTE;
a05b85b
-		else if (ContractNamespace.CONTRACT_NAMESPACE.equals(ns))
a05b85b
-			name = ContractNamespace.CAPABILITY_VERSION_ATTRIBUTE;
a05b85b
+		else if ("osgi.extender".equals(ns))
a05b85b
+			name = "version";
a05b85b
+		else if ("osgi.contract".equals(ns))
a05b85b
+			name = "version";
a05b85b
 		else
a05b85b
 			name = null;
a05b85b
 
a05b85b
-- 
a16fbef
2.7.4
a05b85b