aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jwr...@apache.org
Subject svn commit: r1451753 - in /aries/trunk/subsystem/subsystem-obr/src/main/java/org/apache/aries/subsystem/obr/internal: FelixCapabilityAdapter.java OsgiRequirementAdapter.java
Date Fri, 01 Mar 2013 22:46:29 GMT
Author: jwross
Date: Fri Mar  1 22:46:29 2013
New Revision: 1451753

URL: http://svn.apache.org/r1451753
Log:
Null osgi.wiring.bundle attribute and static multiplicity.

Fixed issue where the osgi capability adapted from the felix capability always presented with
a null value for the osgi.wiring.bundle attribute.

Fixed issue where the felix requirement adapted from the osgi requirement always presented
a single cardinality (or false multiplicity).

Modified:
    aries/trunk/subsystem/subsystem-obr/src/main/java/org/apache/aries/subsystem/obr/internal/FelixCapabilityAdapter.java
    aries/trunk/subsystem/subsystem-obr/src/main/java/org/apache/aries/subsystem/obr/internal/OsgiRequirementAdapter.java

Modified: aries/trunk/subsystem/subsystem-obr/src/main/java/org/apache/aries/subsystem/obr/internal/FelixCapabilityAdapter.java
URL: http://svn.apache.org/viewvc/aries/trunk/subsystem/subsystem-obr/src/main/java/org/apache/aries/subsystem/obr/internal/FelixCapabilityAdapter.java?rev=1451753&r1=1451752&r2=1451753&view=diff
==============================================================================
--- aries/trunk/subsystem/subsystem-obr/src/main/java/org/apache/aries/subsystem/obr/internal/FelixCapabilityAdapter.java
(original)
+++ aries/trunk/subsystem/subsystem-obr/src/main/java/org/apache/aries/subsystem/obr/internal/FelixCapabilityAdapter.java
Fri Mar  1 22:46:29 2013
@@ -16,6 +16,7 @@ package org.apache.aries.subsystem.obr.i
 import java.util.Collections;
 import java.util.Map;
 
+import org.osgi.framework.namespace.BundleNamespace;
 import org.osgi.namespace.service.ServiceNamespace;
 import org.osgi.resource.Resource;
 
@@ -34,7 +35,9 @@ public class FelixCapabilityAdapter exte
 		Map<String, Object> result = capability.getPropertiesAsMap();
 		String namespace = getNamespace();
 		if (ServiceNamespace.SERVICE_NAMESPACE.equals(namespace))
-			result.put(ServiceNamespace.CAPABILITY_OBJECTCLASS_ATTRIBUTE, result.get("objectclass"));
+			result.put(ServiceNamespace.CAPABILITY_OBJECTCLASS_ATTRIBUTE, result.get(ServiceNamespace.CAPABILITY_OBJECTCLASS_ATTRIBUTE.toLowerCase()));
+		else if (BundleNamespace.BUNDLE_NAMESPACE.equals(namespace))
+			result.put(BundleNamespace.BUNDLE_NAMESPACE, result.get(org.apache.felix.bundlerepository.Resource.SYMBOLIC_NAME));
 		else
 			result.put(namespace, result.get(capability.getName()));
 		return result;

Modified: aries/trunk/subsystem/subsystem-obr/src/main/java/org/apache/aries/subsystem/obr/internal/OsgiRequirementAdapter.java
URL: http://svn.apache.org/viewvc/aries/trunk/subsystem/subsystem-obr/src/main/java/org/apache/aries/subsystem/obr/internal/OsgiRequirementAdapter.java?rev=1451753&r1=1451752&r2=1451753&view=diff
==============================================================================
--- aries/trunk/subsystem/subsystem-obr/src/main/java/org/apache/aries/subsystem/obr/internal/OsgiRequirementAdapter.java
(original)
+++ aries/trunk/subsystem/subsystem-obr/src/main/java/org/apache/aries/subsystem/obr/internal/OsgiRequirementAdapter.java
Fri Mar  1 22:46:29 2013
@@ -19,6 +19,7 @@ import static org.apache.aries.applicati
 import org.apache.felix.bundlerepository.Capability;
 import org.apache.felix.bundlerepository.Requirement;
 import org.osgi.framework.Constants;
+import org.osgi.resource.Namespace;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -50,7 +51,8 @@ public class OsgiRequirementAdapter impl
 	}
 
 	public boolean isMultiple() {
-		return false;
+		String multiple = requirement.getDirectives().get(Namespace.REQUIREMENT_CARDINALITY_DIRECTIVE);
+		return Namespace.CARDINALITY_MULTIPLE.equals(multiple);
 	}
 
 	public boolean isOptional() {



Mime
View raw message