Return-Path: X-Original-To: apmail-felix-commits-archive@www.apache.org Delivered-To: apmail-felix-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A0D1468FC for ; Thu, 21 Jul 2011 16:08:58 +0000 (UTC) Received: (qmail 70440 invoked by uid 500); 21 Jul 2011 16:08:58 -0000 Delivered-To: apmail-felix-commits-archive@felix.apache.org Received: (qmail 70364 invoked by uid 500); 21 Jul 2011 16:08:57 -0000 Mailing-List: contact commits-help@felix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@felix.apache.org Delivered-To: mailing list commits@felix.apache.org Received: (qmail 70353 invoked by uid 99); 21 Jul 2011 16:08:57 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Jul 2011 16:08:57 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Jul 2011 16:08:56 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 812C32388A2C for ; Thu, 21 Jul 2011 16:08:36 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1149247 - /felix/trunk/framework/src/main/java/org/apache/felix/framework/util/manifestparser/ManifestParser.java Date: Thu, 21 Jul 2011 16:08:35 -0000 To: commits@felix.apache.org From: rickhall@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110721160836.812C32388A2C@eris.apache.org> Author: rickhall Date: Thu Jul 21 16:08:32 2011 New Revision: 1149247 URL: http://svn.apache.org/viewvc?rev=1149247&view=rev Log: Bundle/host capabilities and host requirement can now have attributes and directives. (FELIX-2950) Modified: felix/trunk/framework/src/main/java/org/apache/felix/framework/util/manifestparser/ManifestParser.java Modified: felix/trunk/framework/src/main/java/org/apache/felix/framework/util/manifestparser/ManifestParser.java URL: http://svn.apache.org/viewvc/felix/trunk/framework/src/main/java/org/apache/felix/framework/util/manifestparser/ManifestParser.java?rev=1149247&r1=1149246&r2=1149247&view=diff ============================================================================== --- felix/trunk/framework/src/main/java/org/apache/felix/framework/util/manifestparser/ManifestParser.java (original) +++ felix/trunk/framework/src/main/java/org/apache/felix/framework/util/manifestparser/ManifestParser.java Thu Jul 21 16:08:32 2011 @@ -127,7 +127,7 @@ public class ManifestParser hostAttrs.put(BundleRevision.HOST_NAMESPACE, value); capList.add(new BundleCapabilityImpl( owner, BundleRevision.HOST_NAMESPACE, - Collections.EMPTY_MAP, + bundleCap.getDirectives(), hostAttrs)); } } @@ -138,6 +138,8 @@ public class ManifestParser // attach this information to the bundle or host capabilities // because fragments don't have those capabilities, but fragments // can be singletons too. +// TODO: OSGi R4.4 - Eventually we will have an identity capability from OBR +// that we can use instead of this custom singleton capability. if (isSingleton(bundleCap)) { Map singletonAttrs = @@ -1321,21 +1323,10 @@ public class ManifestParser + headerMap.get(Constants.FRAGMENT_HOST)); } - // Strip all attributes other than bundle-version. - for (Iterator> it = - clauses.get(0).m_attrs.entrySet().iterator(); - it.hasNext(); ) - { - Entry entry = it.next(); - if (!entry.getKey().equals(Constants.BUNDLE_VERSION_ATTRIBUTE)) - { - it.remove(); - } - } - // If the bundle-version attribute is specified, then convert // it to the proper type. Object value = clauses.get(0).m_attrs.get(Constants.BUNDLE_VERSION_ATTRIBUTE); + value = (value == null) ? "0.0.0" : value; if (value != null) { clauses.get(0).m_attrs.put(