Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 198272 Details for
Bug 349618
[R4.4] Framework support for Resource, etc. in OSGi 4.4
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
updated work in progress
349618.txt (text/plain), 90.51 KB, created by
Thomas Watson
on 2011-06-20 13:37:03 EDT
(
hide
)
Description:
updated work in progress
Filename:
MIME Type:
Creator:
Thomas Watson
Created:
2011-06-20 13:37:03 EDT
Size:
90.51 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.equinox.region.tests >Index: src/org/eclipse/equinox/internal/region/hook/RegionResolverHookTests.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/components/bundles/org.eclipse.equinox.region.tests/src/org/eclipse/equinox/internal/region/hook/RegionResolverHookTests.java,v >retrieving revision 1.3 >diff -u -r1.3 RegionResolverHookTests.java >--- src/org/eclipse/equinox/internal/region/hook/RegionResolverHookTests.java 4 May 2011 03:14:44 -0000 1.3 >+++ src/org/eclipse/equinox/internal/region/hook/RegionResolverHookTests.java 20 Jun 2011 17:35:15 -0000 >@@ -403,6 +403,11 @@ > } > > @Override >+ public BundleRevision getResource() { >+ return getRevision(); >+ } >+ >+ @Override > public BundleRevision getRevision() { > return new StubBundleRevision(bundle(this.bundleSymbolicName)); > } >@@ -481,6 +486,11 @@ > } > > @Override >+ public BundleRevision getResource() { >+ return getRevision(); >+ } >+ >+ @Override > public BundleRevision getRevision() { > return new StubBundleRevision(bundle(this.bundleSymbolicName)); > } >@@ -543,6 +553,11 @@ > } > > @Override >+ public BundleRevision getResource() { >+ return getRevision(); >+ } >+ >+ @Override > public BundleRevision getRevision() { > return this.bundleRevision; > } >@@ -552,6 +567,12 @@ > throw new UnsupportedOperationException(); > } > >+ @Override >+ public boolean matches(Capability capability) { >+ if (!(capability instanceof BundleCapability)) >+ return false; >+ return matches((BundleCapability) capability); >+ } > } > > final class StubBundleRevision implements BundleRevision { >@@ -597,6 +618,17 @@ > throw new UnsupportedOperationException(); > } > >+ @SuppressWarnings({"cast", "unchecked", "rawtypes"}) >+ @Override >+ public List<Capability> getCapabilities(String namespace) { >+ return (List<Capability>) (List) getDeclaredCapabilities(namespace); >+ } >+ >+ @SuppressWarnings({"cast", "unchecked", "rawtypes"}) >+ @Override >+ public List<Requirement> getRequirements(String namespace) { >+ return (List<Requirement>) (List) getDeclaredRequirements(namespace); >+ } > } > > } >#P org.eclipse.osgi >Index: .settings/.api_filters >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/framework/bundles/org.eclipse.osgi/.settings/.api_filters,v >retrieving revision 1.52 >diff -u -r1.52 .api_filters >--- .settings/.api_filters 16 Feb 2011 20:45:18 -0000 1.52 >+++ .settings/.api_filters 20 Jun 2011 17:35:16 -0000 >@@ -989,6 +989,11 @@ > <message_argument value="org.osgi.framework.wiring.BundleCapability"/> > </message_arguments> > </filter> >+<filter comment="Ignore osgi API." id="1211105284"> >+<message_arguments> >+<message_argument value="getResource()"/> >+</message_arguments> >+</filter> > </resource> > <resource path="osgi/src/org/osgi/framework/wiring/BundleRequirement.java" type="org.osgi.framework.wiring.BundleRequirement"> > <filter comment="Ignore OSGi API" id="1110441988"> >@@ -996,6 +1001,11 @@ > <message_argument value="org.osgi.framework.wiring.BundleRequirement"/> > </message_arguments> > </filter> >+<filter comment="Ignore osgi API." id="1211105284"> >+<message_arguments> >+<message_argument value="getResource()"/> >+</message_arguments> >+</filter> > </resource> > <resource path="osgi/src/org/osgi/framework/wiring/BundleRevision.java" type="org.osgi.framework.wiring.BundleRevision"> > <filter comment="Ignore OSGi API" id="1110441988"> >@@ -1017,6 +1027,16 @@ > <message_argument value="org.osgi.framework.wiring.BundleWire"/> > </message_arguments> > </filter> >+<filter comment="Ignore osgi API." id="1211105284"> >+<message_arguments> >+<message_argument value="getProvider()"/> >+</message_arguments> >+</filter> >+<filter comment="Ignore osgi API." id="1211105284"> >+<message_arguments> >+<message_argument value="getRequirer()"/> >+</message_arguments> >+</filter> > </resource> > <resource path="osgi/src/org/osgi/framework/wiring/BundleWiring.java" type="org.osgi.framework.wiring.BundleWiring"> > <filter comment="Ignore OSGi API" id="1110441988"> >@@ -1025,6 +1045,13 @@ > </message_arguments> > </filter> > </resource> >+<resource path="osgi/src/org/osgi/framework/wiring/Capability.java" type="org.osgi.framework.wiring.Capability"> >+<filter comment="Ignore osgi API." id="1110441988"> >+<message_arguments> >+<message_argument value="org.osgi.framework.wiring.Capability"/> >+</message_arguments> >+</filter> >+</resource> > <resource path="osgi/src/org/osgi/framework/wiring/FrameworkWiring.java" type="org.osgi.framework.wiring.FrameworkWiring"> > <filter comment="Ignore OSGi API" id="1110441988"> > <message_arguments> >@@ -1032,6 +1059,34 @@ > </message_arguments> > </filter> > </resource> >+<resource path="osgi/src/org/osgi/framework/wiring/Requirement.java" type="org.osgi.framework.wiring.Requirement"> >+<filter comment="Ignore osgi API." id="1110441988"> >+<message_arguments> >+<message_argument value="org.osgi.framework.wiring.Requirement"/> >+</message_arguments> >+</filter> >+</resource> >+<resource path="osgi/src/org/osgi/framework/wiring/Resource.java" type="org.osgi.framework.wiring.Resource"> >+<filter comment="Ignore osgi API." id="1110441988"> >+<message_arguments> >+<message_argument value="org.osgi.framework.wiring.Resource"/> >+</message_arguments> >+</filter> >+</resource> >+<resource path="osgi/src/org/osgi/framework/wiring/ResourceConstants.java" type="org.osgi.framework.wiring.ResourceConstants"> >+<filter comment="Ignore osgi API." id="1110441988"> >+<message_arguments> >+<message_argument value="org.osgi.framework.wiring.ResourceConstants"/> >+</message_arguments> >+</filter> >+</resource> >+<resource path="osgi/src/org/osgi/framework/wiring/Wire.java" type="org.osgi.framework.wiring.Wire"> >+<filter comment="Ignore osgi API." id="1110441988"> >+<message_arguments> >+<message_argument value="org.osgi.framework.wiring.Wire"/> >+</message_arguments> >+</filter> >+</resource> > <resource path="osgi/src/org/osgi/service/condpermadmin/ConditionalPermissionAdmin.java" type="org.osgi.service.condpermadmin.ConditionalPermissionAdmin"> > <filter comment="Ignore OSGi API" id="403853384"> > <message_arguments> >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/framework/bundles/org.eclipse.osgi/META-INF/MANIFEST.MF,v >retrieving revision 1.102 >diff -u -r1.102 MANIFEST.MF >--- META-INF/MANIFEST.MF 10 Jun 2011 13:04:38 -0000 1.102 >+++ META-INF/MANIFEST.MF 20 Jun 2011 17:35:16 -0000 >@@ -25,7 +25,7 @@ > org.osgi.framework.hooks.service; version="1.1", > org.osgi.framework.hooks.weaving; version="1.0", > org.osgi.framework.startlevel; version="1.0", >- org.osgi.framework.wiring; version="1.0", >+ org.osgi.framework.wiring; version="1.1", > org.osgi.service.condpermadmin;version="1.1.1", > org.osgi.service.framework; version="1.0"; x-internal:=true, > org.osgi.service.log; version="1.3", >@@ -75,7 +75,7 @@ > Bundle-Description: %systemBundle > Bundle-Copyright: %copyright > Bundle-Vendor: %eclipse.org >-Bundle-Version: 3.7.100.qualifier >+Bundle-Version: 3.8.0.qualifier > Bundle-Localization: systembundle > Bundle-DocUrl: http://www.eclipse.org > Eclipse-ExtensibleAPI: true >Index: osgi/src/org/osgi/framework/wiring/BundleCapability.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/framework/bundles/org.eclipse.osgi/osgi/src/org/osgi/framework/wiring/BundleCapability.java,v >retrieving revision 1.3 >diff -u -r1.3 BundleCapability.java >--- osgi/src/org/osgi/framework/wiring/BundleCapability.java 28 Feb 2011 19:52:42 -0000 1.3 >+++ osgi/src/org/osgi/framework/wiring/BundleCapability.java 20 Jun 2011 17:35:16 -0000 >@@ -18,15 +18,16 @@ > > import java.util.Map; > >+ > /** > * A capability that has been declared from a {@link BundleRevision bundle > * revision}. > * > * @ThreadSafe > * @noimplement >- * @version $Id: 0fde13c3228af1aa97872b37ccf0aa6e23123b11 $ >+ * @version $Id: 6bbc1e645f927531d40fb245c95f5d26ad189db3 $ > */ >-public interface BundleCapability { >+public interface BundleCapability extends Capability{ > /** > * Returns the name space of this capability. > * >@@ -58,4 +59,6 @@ > * @return The bundle revision declaring this capability. > */ > BundleRevision getRevision(); >+ >+ BundleRevision getResource(); > } >Index: osgi/src/org/osgi/framework/wiring/BundleRequirement.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/framework/bundles/org.eclipse.osgi/osgi/src/org/osgi/framework/wiring/BundleRequirement.java,v >retrieving revision 1.3 >diff -u -r1.3 BundleRequirement.java >--- osgi/src/org/osgi/framework/wiring/BundleRequirement.java 28 Feb 2011 19:52:42 -0000 1.3 >+++ osgi/src/org/osgi/framework/wiring/BundleRequirement.java 20 Jun 2011 17:35:16 -0000 >@@ -18,15 +18,16 @@ > > import java.util.Map; > >+ > /** > * A requirement that has been declared from a {@link BundleRevision bundle > * revision}. > * > * @ThreadSafe > * @noimplement >- * @version $Id: 659132c1fac7526240df377ead0e1bc8d4af2e77 $ >+ * @version $Id: 3ee254a3c0d5516b56affaa66544c892f3d522cb $ > */ >-public interface BundleRequirement { >+public interface BundleRequirement extends Requirement{ > /** > * Returns the name space of this requirement. > * >@@ -60,6 +61,11 @@ > BundleRevision getRevision(); > > /** >+ * {@inheritDoc} >+ */ >+ BundleRevision getResource(); >+ >+ /** > * Returns whether the specified capability matches this requirement. > * > * @param capability The capability to match to this requirement. >Index: osgi/src/org/osgi/framework/wiring/BundleRevision.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/framework/bundles/org.eclipse.osgi/osgi/src/org/osgi/framework/wiring/BundleRevision.java,v >retrieving revision 1.4 >diff -u -r1.4 BundleRevision.java >--- osgi/src/org/osgi/framework/wiring/BundleRevision.java 28 Feb 2011 19:52:42 -0000 1.4 >+++ osgi/src/org/osgi/framework/wiring/BundleRevision.java 20 Jun 2011 17:35:16 -0000 >@@ -47,9 +47,9 @@ > * > * @ThreadSafe > * @noimplement >- * @version $Id: 139b3046ebd46c48b03dda8d36f2f9d79e2e616d $ >+ * @version $Id: 2eb450f15fc9d4fe1b611dc55e2238b972b4c486 $ > */ >-public interface BundleRevision extends BundleReference { >+public interface BundleRevision extends BundleReference, Resource { > /** > * Returns the symbolic name for this bundle revision. > * >@@ -137,7 +137,7 @@ > * package wires required by a bundle wiring may change as the bundle wiring > * may dynamically import additional packages. > */ >- String PACKAGE_NAMESPACE = "osgi.wiring.package"; >+ String PACKAGE_NAMESPACE = ResourceConstants.WIRING_PACKAGE_NAMESPACE; > > /** > * Name space for bundle capabilities and requirements. >@@ -175,7 +175,7 @@ > * {@link Constants#BUNDLE_MANIFESTVERSION Bundle-ManifestVersion} > * {@literal <} 2) must not provide a bundle capability. > */ >- String BUNDLE_NAMESPACE = "osgi.wiring.bundle"; >+ String BUNDLE_NAMESPACE = ResourceConstants.WIRING_BUNDLE_NAMESPACE; > > /** > * Name space for host capabilities and requirements. >@@ -216,7 +216,7 @@ > * {@link Constants#BUNDLE_MANIFESTVERSION Bundle-ManifestVersion} > * {@literal <} 2) must not provide a host capability. > */ >- String HOST_NAMESPACE = "osgi.wiring.host"; >+ String HOST_NAMESPACE = ResourceConstants.WIRING_HOST_NAMESPACE; > > /** > * Returns the special types of this bundle revision. The bundle revision >Index: osgi/src/org/osgi/framework/wiring/BundleWire.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/framework/bundles/org.eclipse.osgi/osgi/src/org/osgi/framework/wiring/BundleWire.java,v >retrieving revision 1.3 >diff -u -r1.3 BundleWire.java >--- osgi/src/org/osgi/framework/wiring/BundleWire.java 28 Feb 2011 19:52:42 -0000 1.3 >+++ osgi/src/org/osgi/framework/wiring/BundleWire.java 20 Jun 2011 17:35:16 -0000 >@@ -16,14 +16,15 @@ > > package org.osgi.framework.wiring; > >+ > /** > * A wire connecting a {@link BundleCapability} to a {@link BundleRequirement}. > * > * @ThreadSafe > * @noimplement >- * @version $Id: 4f936a84065762ec3267a44f86ae01b0150e44ce $ >+ * @version $Id: aca8642cea91995d0b178129cba1131ed327c7e7 $ > */ >-public interface BundleWire { >+public interface BundleWire extends Wire { > /** > * Returns the {@link BundleCapability} for this wire. > * >@@ -69,4 +70,14 @@ > * returned. > */ > BundleWiring getRequirerWiring(); >+ >+ /** >+ * {@inheritDoc} >+ */ >+ BundleRevision getProvider(); >+ >+ /** >+ * {@inheritDoc} >+ */ >+ BundleRevision getRequirer(); > } >Index: osgi/src/org/osgi/framework/wiring/Capability.java >=================================================================== >RCS file: osgi/src/org/osgi/framework/wiring/Capability.java >diff -N osgi/src/org/osgi/framework/wiring/Capability.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ osgi/src/org/osgi/framework/wiring/Capability.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,82 @@ >+/* >+ * Copyright (c) OSGi Alliance (2010, 2011). All Rights Reserved. >+ * >+ * Licensed under the Apache License, Version 2.0 (the "License"); >+ * you may not use this file except in compliance with the License. >+ * You may obtain a copy of the License at >+ * >+ * http://www.apache.org/licenses/LICENSE-2.0 >+ * >+ * Unless required by applicable law or agreed to in writing, software >+ * distributed under the License is distributed on an "AS IS" BASIS, >+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. >+ * See the License for the specific language governing permissions and >+ * limitations under the License. >+ */ >+ >+package org.osgi.framework.wiring; >+ >+import java.util.Map; >+ >+/** >+ * A capability that has been declared from a {@link Resource}. >+ * >+ * @ThreadSafe >+ * @version $Id: f8bd10002691537806e4bc3cf08f3fce37510121 $ >+ */ >+public interface Capability { >+ >+ /** >+ * Returns the name space of this capability. >+ * >+ * @return The name space of this capability. >+ */ >+ String getNamespace(); >+ >+ /** >+ * Returns the directives of this capability. Only the following list of >+ * directives have semantic meaning in the returned {@link Map map} of >+ * directives: >+ * <ul> >+ * <li> {@link ResourceConstants#CAPABILITY_EFFECTIVE_DIRECTIVE effective} >+ * <li> {@link ResourceConstants#CAPABILITY_USES_DIRECTIVE uses} >+ * <li> {@link ResourceConstants#CAPABILITY_MANDATORY_DIRECTIVE mandatory} - >+ * only recognized for the >+ * {@link ResourceConstants#WIRING_BUNDLE_NAMESPACE osgi.wiring.bundle} and >+ * {@link ResourceConstants#WIRING_PACKAGE_NAMESPACE osgi.wiring.package} >+ * name spaces. >+ * <li> {@link ResourceConstants#CAPABILITY_EXCLUDE_DIRECTIVE exclude} - >+ * only recognized for the >+ * {@link ResourceConstants#WIRING_PACKAGE_NAMESPACE osgi.wiring.package} >+ * name space. >+ * <li> {@link ResourceConstants#CAPABILITY_INCLUDE_DIRECTIVE include} - >+ * only recognized for the >+ * {@link ResourceConstants#WIRING_PACKAGE_NAMESPACE osgi.wiring.package} >+ * name space. >+ * </ul> >+ * All other directive are considered extra user defined information that >+ * has no semantic meaning. OSGi Alliance reserves the right to extend the >+ * set of directives which have semantic meaning. >+ * >+ * @return An unmodifiable map of directive names to directive values for >+ * this capability, or an empty map if this capability has no >+ * directives. >+ */ >+ Map<String, String> getDirectives(); >+ >+ /** >+ * Returns the attributes of this capability. >+ * >+ * @return An unmodifiable map of attribute names to attribute values for >+ * this capability, or an empty map if this capability has no >+ * attributes. >+ */ >+ Map<String, Object> getAttributes(); >+ >+ /** >+ * The resource that declares this capability. >+ * >+ * @return the resource >+ */ >+ Resource getResource(); >+} >Index: osgi/src/org/osgi/framework/wiring/Requirement.java >=================================================================== >RCS file: osgi/src/org/osgi/framework/wiring/Requirement.java >diff -N osgi/src/org/osgi/framework/wiring/Requirement.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ osgi/src/org/osgi/framework/wiring/Requirement.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,104 @@ >+/* >+ * Copyright (c) OSGi Alliance (2010, 2011). All Rights Reserved. >+ * >+ * Licensed under the Apache License, Version 2.0 (the "License"); >+ * you may not use this file except in compliance with the License. >+ * You may obtain a copy of the License at >+ * >+ * http://www.apache.org/licenses/LICENSE-2.0 >+ * >+ * Unless required by applicable law or agreed to in writing, software >+ * distributed under the License is distributed on an "AS IS" BASIS, >+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. >+ * See the License for the specific language governing permissions and >+ * limitations under the License. >+ */ >+ >+package org.osgi.framework.wiring; >+ >+import java.util.Map; >+ >+import org.osgi.framework.Constants; >+ >+/** >+ * A requirement that has been declared from a {@link Resource} . >+ * >+ * @ThreadSafe >+ * @version $Id: 6a5c3253e257d6f503a39d94563d7d656ce05e1d $ >+ */ >+public interface Requirement { >+ /** >+ * Returns the name space of this requirement. >+ * >+ * @return The name space of this requirement. >+ */ >+ String getNamespace(); >+ >+ /** >+ * Returns the directives of this requirement. Only the following list of >+ * directives have semantic meaning in the returned {@link Map map} of >+ * directives: >+ * <ul> >+ * <li> {@link ResourceConstants#REQUIREMENT_EFFECTIVE_DIRECTIVE effective} >+ * <li> {@link ResourceConstants#REQUIREMENT_FILTER_DIRECTIVE filter} >+ * <li> {@link ResourceConstants#REQUIREMENT_CARDINALITY_DIRECTIVE >+ * cardinality} >+ * <li> {@link ResourceConstants#REQUIREMENT_RESOLUTION_DIRECTIVE resolution} >+ * <li> {@link ResourceConstants#REQUIREMENT_VISIBILITY_DIRECTIVE visibility} >+ * - only recognized for the >+ * {@link ResourceConstants#WIRING_BUNDLE_NAMESPACE osgi.wiring.bundle} name >+ * space. >+ * </ul> >+ * All other directive are considered extra user defined information that >+ * has no semantic meaning. OSGi Alliance reserves the right to extend the >+ * set of directives which have semantic meaning. >+ * >+ * @return An unmodifiable map of directive names to directive values for >+ * this requirement, or an empty map if this requirement has no >+ * directives. >+ */ >+ Map<String, String> getDirectives(); >+ >+ /** >+ * Returns the attributes of this requirement. Requirement attributes have >+ * no semantic meaning and are considered extra user defined information. >+ * >+ * @return An unmodifiable map of attribute names to attribute values for >+ * this requirement, or an empty map if this requirement has no >+ * attributes. >+ */ >+ Map<String, Object> getAttributes(); >+ >+ /** >+ * Returns the resource declaring this requirement. >+ * >+ * @return The resource declaring this requirement. >+ */ >+ Resource getResource(); >+ >+ /** >+ * Returns whether the specified capability matches this requirement. A >+ * capability matches this requirement when all of the following are true: >+ * <ul> >+ * <li>The specified capability has the same {@link #getNamespace() name >+ * space} as this requirement. >+ * <li>The filter specified by the {@link Constants#FILTER_DIRECTIVE filter} >+ * directive of this requirement matches the >+ * {@link Capability#getAttributes() attributes of the specified capability}. >+ * <li>The {@link #getDirectives() requirement directives} and the >+ * {@link Capability#getDirectives() capability directives} that apply to >+ * the name space are satisfied. >+ * </ul> >+ * >+ * >+ * @param capability >+ * The capability to match to this requirement. >+ * @return {@code true} if the specified capability matches this this >+ * requirement. {@link #getNamespace() name space} as this >+ * requirement and the filter for this requirement matches the >+ * {@link BundleCapability#getAttributes() attributes of the >+ * specified capability}; {@code false} otherwise. >+ */ >+ // TODO much debate on the placement and need for this method. >+ boolean matches(Capability capability); >+} >Index: osgi/src/org/osgi/framework/wiring/Resource.java >=================================================================== >RCS file: osgi/src/org/osgi/framework/wiring/Resource.java >diff -N osgi/src/org/osgi/framework/wiring/Resource.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ osgi/src/org/osgi/framework/wiring/Resource.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,46 @@ >+package org.osgi.framework.wiring; >+ >+import java.util.List; >+ >+ >+/** >+ * A resource is the representation of a uniquely identified and typed data. >+ * >+ * A resources can be wired together via capabilities and requirements. >+ * >+ * TODO decide on identity characteristics of a revision. Given in OSGi multiple >+ * bundles can be installed with same bsn/version this cannot be used as a key. >+ * >+ * What then is identity of a resource? Object identity? URI (needs getter >+ * method?) >+ * >+ * @ThreadSafe >+ * @version $Id: 0d09cf5655002b7b2f1d37d413788892ad2dfedf $ >+ */ >+public interface Resource { >+ /** >+ * Returns the capabilities declared by this resource. >+ * >+ * @param namespace >+ * The name space of the declared capabilities to return or >+ * {@code null} to return the declared capabilities from all name >+ * spaces. >+ * @return A list containing a snapshot of the declared {@link Capability}s, >+ * or an empty list if this resource declares no capabilities in the >+ * specified name space. >+ */ >+ List<Capability> getCapabilities(String namespace); >+ >+ /** >+ * Returns the requirements declared by this bundle resource. >+ * >+ * @param namespace >+ * The name space of the declared requirements to return or >+ * {@code null} to return the declared requirements from all name >+ * spaces. >+ * @return A list containing a snapshot of the declared {@link Requirement} >+ * s, or an empty list if this resource declares no requirements in >+ * the specified name space. >+ */ >+ List<Requirement> getRequirements(String namespace); >+} >Index: osgi/src/org/osgi/framework/wiring/ResourceConstants.java >=================================================================== >RCS file: osgi/src/org/osgi/framework/wiring/ResourceConstants.java >diff -N osgi/src/org/osgi/framework/wiring/ResourceConstants.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ osgi/src/org/osgi/framework/wiring/ResourceConstants.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,364 @@ >+/* >+ * Copyright (c) OSGi Alliance (2011). All Rights Reserved. >+ * >+ * Licensed under the Apache License, Version 2.0 (the "License"); >+ * you may not use this file except in compliance with the License. >+ * You may obtain a copy of the License at >+ * >+ * http://www.apache.org/licenses/LICENSE-2.0 >+ * >+ * Unless required by applicable law or agreed to in writing, software >+ * distributed under the License is distributed on an "AS IS" BASIS, >+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. >+ * See the License for the specific language governing permissions and >+ * limitations under the License. >+ */ >+package org.osgi.framework.wiring; >+ >+import org.osgi.framework.Constants; >+import org.osgi.framework.Version; >+ >+/** >+ * Defines standard names for the attributes, directives and name spaces for >+ * resources, capabilities and requirements. >+ * >+ * <p> >+ * The values associated with these keys are of type {@code String}, unless >+ * otherwise indicated. >+ * >+ * @version $Id: 6a0df41f82a587eb72c0c513fdd0411f18564586 $ >+ */ >+public final class ResourceConstants { >+ >+ private ResourceConstants() { >+ // keep others from creating objects of this type. >+ } >+ >+ /** >+ * Name space for the identity capability. Each {@link Resource resource} >+ * should provide an identity capability that can be used to identify the >+ * resource. >+ * >+ * For identity capability attributes the following applies: >+ * <ul> >+ * <li>The >+ * <q>osgi.identity</q> attribute contains the symbolic name of the >+ * resource. >+ * <li>The {@link #IDENTITY_VERSION_ATTRIBUTE version} attribute contains >+ * the {@link Version} of the resource. >+ * <li>The {@link #IDENTITY_TYPE_ATTRIBUTE type} attribute contains the >+ * resource type. >+ * </ul> >+ * <p> >+ * A resource with a symbolic name provides exactly one <sup>†</sup> identity >+ * {@link Resource#getCapabilities(String) capability}. >+ * <p> >+ * † A resource with no symbolic name must not provide an identity >+ * capability. >+ */ >+ public static final String IDENTITY_NAMESPACE = "osgi.identity"; >+ >+ /** >+ * An {@link #IDENTITY_NAMESPACE identity} capability attribute identifying the >+ * {@link Version version} of the resource. This attribute must be set to a value of >+ * type {@link Version}. If the resource has no version then the value >+ * {@link Version#emptyVersion 0.0.0} must be used for the attribute. >+ */ >+ public static final String IDENTITY_VERSION_ATTRIBUTE = Constants.VERSION_ATTRIBUTE; >+ >+ /** >+ * An {@link #IDENTITY_NAMESPACE identity} capability attribute identifying the >+ * resource type. This attribute must be set to a value of type {@link String}. >+ * if the resource has no type then the value >+ * {@link ResourceConstants#IDENTITY_TYPE_UNKNOWN unknown} must be used for the >+ * attribute. >+ */ >+ public static final String IDENTITY_TYPE_ATTRIBUTE = "type"; >+ >+ /** >+ * An {@link #IDENTITY_NAMESPACE identity} capability {@link #IDENTITY_TYPE_ATTRIBUTE type} >+ * attribute value identifying the resource type as an OSGi bundle. >+ */ >+ public static final String IDENTITY_TYPE_BUNDLE = "osgi.bundle"; >+ >+ /** >+ * An {@link #IDENTITY_NAMESPACE identity} capability {@link #IDENTITY_TYPE_ATTRIBUTE type} >+ * attribute value identifying the resource type as an OSGi fragment. >+ */ >+ public static final String IDENTITY_TYPE_FRAGMENT = "osgi.fragment"; >+ >+ /** >+ * An {@link #IDENTITY_NAMESPACE identity} capability {@link #IDENTITY_TYPE_ATTRIBUTE type} >+ * attribute value identifying the resource type as unknown. >+ */ >+ public static final String IDENTITY_TYPE_UNKNOWN = "unknown"; >+ >+ /** >+ * An {@link #IDENTITY_NAMESPACE identity} capability {@link Requirement#getDirectives() directive} >+ * identifying if the resource is a singleton. A {@link String} value of "true" indicates >+ * the resource is a singleton; any other value or <code>null</code> indicates the resource is not a >+ * singleton. >+ */ >+ public static final String IDENTITY_SINGLETON_DIRECTIVE = Constants.SINGLETON_DIRECTIVE; >+ >+ /** >+ * Name space for package capabilities and requirements. >+ * >+ * For capability attributes the following applies: >+ * <ul> >+ * <li>The >+ * <q>osgi.wiring.package</q> attribute contains the name of the package. >+ * <li>The {@link Constants#VERSION_ATTRIBUTE version} attribute contains >+ * the the {@link Version} of the package if one is specified or >+ * {@link Version#emptyVersion} if not specified. >+ * <li>The {@link Constants#BUNDLE_SYMBOLICNAME_ATTRIBUTE >+ * bundle-symbolic-name} attribute contains the symbolic name of the >+ * resource providing the package if one is specified. >+ * <li>The {@link Constants#BUNDLE_VERSION_ATTRIBUTE bundle-version} >+ * attribute contains the {@link Version} of resource providing the package >+ * if one is specified or {@link Version#emptyVersion} if not specified. >+ * <li>All other attributes are of type {@link String} and are used as >+ * arbitrary matching attributes for the capability. >+ * </ul> >+ * <p> >+ * A resource provides zero or more package >+ * {@link Resource#getCapabilities(String) capabilities} (this is, exported >+ * packages) and requires zero or more package >+ * {@link Resource#getRequirements(String) requirements} (that is, imported >+ * packages). >+ */ >+ public static final String WIRING_PACKAGE_NAMESPACE = "osgi.wiring.package"; >+ >+ /** >+ * Name space for bundle capabilities and requirements. >+ * >+ * For capability attributes the following applies: >+ * <ul> >+ * <li>The >+ * <q>osgi.wiring.bundle</q> attribute contains the symbolic name of the >+ * bundle. >+ * <li>The {@link Constants#BUNDLE_VERSION_ATTRIBUTE bundle-version} >+ * attribute contains the {@link Version} of the bundle if one is specified >+ * or {@link Version#emptyVersion} if not specified. >+ * <li>All other attributes are of type {@link String} and are used as >+ * arbitrary matching attributes for the capability. >+ * </ul> >+ * <p> >+ * A non-fragment resource with the {@link #IDENTITY_TYPE_BUNDLE >+ * osgi.bundle} type {@link #IDENTITY_TYPE_ATTRIBUTE identity} provides >+ * exactly one <sup>†</sup> bundle >+ * {@link Resource#getCapabilities(String) capability} (that is, the bundle >+ * can be required by another bundle). A fragment resource with the >+ * {@link #IDENTITY_TYPE_FRAGMENT osgi.fragment} type >+ * {@link #IDENTITY_TYPE_ATTRIBUTE identity} must not declare >+ * a bundle capability. A resource requires zero or more bundle >+ * {@link Resource#getRequirements(String) requirements} (that is, required >+ * bundles). >+ * <p> >+ * † A resource with no symbolic name must not provide a bundle >+ * capability. >+ */ >+ public static final String WIRING_BUNDLE_NAMESPACE = "osgi.wiring.bundle"; >+ >+ /** >+ * Name space for host capabilities and requirements. >+ * >+ * For capability attributes the following applies: >+ * <ul> >+ * <li>The >+ * <q>osgi.wiring.host</q> attribute contains the symbolic name of the >+ * bundle. >+ * <li>The {@link Constants#BUNDLE_VERSION_ATTRIBUTE bundle-version} >+ * attribute contains the {@link Version} of the bundle if one is specified >+ * or {@link Version#emptyVersion} if not specified. >+ * <li>All other attributes are of type {@link String} and are used as >+ * arbitrary matching attributes for the capability. >+ * </ul> >+ * <p> >+ * <p> >+ * A non-fragment resource with the with the {@link #IDENTITY_TYPE_BUNDLE >+ * osgi.bundle} type {@link #IDENTITY_TYPE_ATTRIBUTE identity} provides >+ * zero or one <sup>†</sup> host >+ * {@link Resource#getCapabilities(String) capabilities}. >+ * A fragment resource with the >+ * {@link #IDENTITY_TYPE_FRAGMENT osgi.fragment} type >+ * {@link #IDENTITY_TYPE_ATTRIBUTE identity} must not declare >+ * a host capability and must >+ * {@link Resource#getRequirements(String) declare} exactly one host >+ * requirement. >+ * <p> >+ * † A resource with no bundle symbolic name must not provide a host >+ * capability. >+ */ >+ public static final String WIRING_HOST_NAMESPACE = "osgi.wiring.host"; >+ >+ /** >+ * A requirement {@link Requirement#getDirectives() directive} used to >+ * specify a capability filter. This filter is used to match against a >+ * capability's {@link Capability#getAttributes() attributes}. >+ */ >+ public final static String REQUIREMENT_FILTER_DIRECTIVE = Constants.FILTER_DIRECTIVE; >+ >+ /** >+ * A requirement {@link Requirement#getDirectives() directive} used to >+ * specify the resolution type for a requirement. The default value is >+ * {@link #REQUIREMENT_RESOLUTION_MANDATORY mandatory}. >+ * >+ * @see #REQUIREMENT_RESOLUTION_MANDATORY mandatory >+ * @see #REQUIREMENT_RESOLUTION_OPTIONAL optional >+ */ >+ public final static String REQUIREMENT_RESOLUTION_DIRECTIVE = Constants.RESOLUTION_DIRECTIVE; >+ /** >+ * A directive value identifying a mandatory >+ * {@link Resource#getRequirements(String) requirement} resolution type. A >+ * mandatory resolution type indicates that the requirement must be resolved >+ * when the {@link Resource resource} is resolved. If such requirement >+ * cannot be resolved, the resource fails to resolve. >+ * >+ * @see #REQUIREMENT_RESOLUTION_DIRECTIVE >+ */ >+ public final static String REQUIREMENT_RESOLUTION_MANDATORY = Constants.RESOLUTION_MANDATORY; >+ >+ /** >+ * A directive value identifying an optional >+ * {@link Resource#getRequirements(String) requirement} resolution type. An >+ * optional resolution type indicates that the requirement is optional and >+ * the {@link Resource resource} may be resolved without requirement being >+ * resolved. >+ * >+ * @see #REQUIREMENT_RESOLUTION_DIRECTIVE >+ */ >+ public final static String REQUIREMENT_RESOLUTION_OPTIONAL = Constants.RESOLUTION_OPTIONAL; >+ >+ /** >+ * A requirement {@link Requirement#getDirectives() directive} used to >+ * specify the effective time for the requirement. The default value is >+ * {@link #EFFECTIVE_RESOLVE resolve}. >+ * >+ * @see #EFFECTIVE_RESOLVE resolve >+ * @see #EFFECTIVE_ACTIVE active >+ */ >+ public final static String REQUIREMENT_EFFECTIVE_DIRECTIVE = Constants.EFFECTIVE_DIRECTIVE; >+ >+ /** >+ * A directive value identifying a {@link #CAPABILITY_EFFECTIVE_DIRECTIVE >+ * capability} or {@link #REQUIREMENT_EFFECTIVE_DIRECTIVE requirement} that >+ * is effective at resolve time. Capabilities and requirements with an >+ * effective time of resolve are the only capabilities which are processed >+ * while resolving a resource. >+ * >+ * @see #REQUIREMENT_EFFECTIVE_DIRECTIVE >+ * @see #CAPABILITY_EFFECTIVE_DIRECTIVE >+ */ >+ public final static String EFFECTIVE_RESOLVE = Constants.EFFECTIVE_RESOLVE; >+ >+ /** >+ * A directive value identifying a {@link #CAPABILITY_EFFECTIVE_DIRECTIVE >+ * capability} or {@link #REQUIREMENT_EFFECTIVE_DIRECTIVE requirement} that >+ * is effective at active time. Capabilities and requirements with an >+ * effective time of active are ignored while resolving a resource. >+ * >+ * @see #REQUIREMENT_EFFECTIVE_DIRECTIVE >+ * @see #CAPABILITY_EFFECTIVE_DIRECTIVE >+ */ >+ public final static String EFFECTIVE_ACTIVE = Constants.EFFECTIVE_ACTIVE; >+ >+ /** >+ * A requirement {@link Requirement#getDirectives() directive} used to >+ * specify the visibility type for a requirement. The default value is >+ * {@link #REQUIREMENT_VISIBILITY_PRIVATE private}. This directive must only >+ * be used for requirements with the require >+ * {@link #WIRING_BUNDLE_NAMESPACE bundle} name space. >+ * >+ * @see #REQUIREMENT_VISIBILITY_PRIVATE private >+ * @see #REQUIREMENT_VISIBILITY_REEXPORT reexport >+ */ >+ public final static String REQUIREMENT_VISIBILITY_DIRECTIVE = Constants.VISIBILITY_DIRECTIVE; >+ >+ /** >+ * A directive value identifying a private >+ * {@link #REQUIREMENT_VISIBILITY_DIRECTIVE visibility} type. A private >+ * visibility type indicates that any {@link #WIRING_PACKAGE_NAMESPACE >+ * packages} that are exported by the required >+ * {@link #WIRING_BUNDLE_NAMESPACE bundle} are not made visible on the >+ * export signature of the requiring {@link #WIRING_BUNDLE_NAMESPACE bundle} >+ * . >+ * >+ * @see #REQUIREMENT_VISIBILITY_DIRECTIVE >+ */ >+ public final static String REQUIREMENT_VISIBILITY_PRIVATE = Constants.VISIBILITY_PRIVATE; >+ >+ /** >+ * A directive value identifying a reexport >+ * {@link #REQUIREMENT_VISIBILITY_DIRECTIVE visibility} type. A reexport >+ * visibility type indicates any {@link #WIRING_PACKAGE_NAMESPACE packages} >+ * that are exported by the required {@link #WIRING_BUNDLE_NAMESPACE bundle} >+ * are re-exported by the requiring {@link #WIRING_BUNDLE_NAMESPACE bundle}. >+ */ >+ public final static String REQUIREMENT_VISIBILITY_REEXPORT = Constants.VISIBILITY_REEXPORT; >+ >+ /** >+ * A requirement {@link Requirement#getDirectives() directive} used to >+ * specify the cardinality for a requirement. The default value is >+ * {@link #REQUIREMENT_CARDINALITY_SINGULAR singular}. >+ * >+ * @see #REQUIREMENT_CARDINALITY_MULTIPLE multiple >+ * @see #REQUIREMENT_CARDINALITY_SINGULAR singular >+ */ >+ public final static String REQUIREMENT_CARDINALITY_DIRECTIVE = "cardinality"; >+ >+ /** >+ * A directive value identifying a multiple >+ * {@link #REQUIREMENT_CARDINALITY_DIRECTIVE cardinality} type. >+ */ >+ public final static String REQUIREMENT_CARDINALITY_MULTIPLE = "multiple"; >+ >+ /** >+ * A directive value identifying a singular >+ * {@link #REQUIREMENT_CARDINALITY_DIRECTIVE cardinality} type. >+ */ >+ public final static String REQUIREMENT_CARDINALITY_SINGULAR = "singular"; >+ >+ /** >+ * A capability {@link Capability#getDirectives() directive} used to specify >+ * the comma separated list of {@link #WIRING_PACKAGE_NAMESPACE package} >+ * names a capability uses. >+ */ >+ public final static String CAPABILITY_USES_DIRECTIVE = Constants.USES_DIRECTIVE; >+ >+ /** >+ * A capability {@link Capability#getDirectives() directive} used to specify >+ * the effective time for the capability. The default value is >+ * {@link #EFFECTIVE_RESOLVE resolve}. >+ * >+ * @see #EFFECTIVE_RESOLVE resolve >+ * @see #EFFECTIVE_ACTIVE active >+ */ >+ public final static String CAPABILITY_EFFECTIVE_DIRECTIVE = Constants.EFFECTIVE_DIRECTIVE; >+ >+ /** >+ * A capability {@link Capability#getDirectives() directive} used to specify >+ * the comma separated list of mandatory attributes which must be specified >+ * in the {@link #REQUIREMENT_FILTER_DIRECTIVE filter} of a requirement in >+ * order for the capability to match the requirement. This directive must >+ * only be used for capabilities with the {@link #WIRING_PACKAGE_NAMESPACE >+ * package} name space. >+ */ >+ public final static String CAPABILITY_MANDATORY_DIRECTIVE = "mandatory"; >+ >+ /** >+ * A capability {@link Capability#getDirectives() directive} used to specify >+ * the comma separated list of classes which must be allowed to be exported. >+ * This directive must only be used for capabilities with the >+ * {@link #WIRING_PACKAGE_NAMESPACE package} name space. >+ */ >+ public final static String CAPABILITY_INCLUDE_DIRECTIVE = "include"; >+ >+ /** >+ * A capability {@link Capability#getDirectives() directive} used to specify >+ * the comma separated list of classes which must not be allowed to be >+ * exported. This directive must only be used for capabilities with the >+ * {@link #WIRING_PACKAGE_NAMESPACE package} name space. >+ */ >+ public final static String CAPABILITY_EXCLUDE_DIRECTIVE = "exclude"; >+} >Index: osgi/src/org/osgi/framework/wiring/Wire.java >=================================================================== >RCS file: osgi/src/org/osgi/framework/wiring/Wire.java >diff -N osgi/src/org/osgi/framework/wiring/Wire.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ osgi/src/org/osgi/framework/wiring/Wire.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,57 @@ >+/* >+ * Copyright (c) OSGi Alliance (2011). All Rights Reserved. >+ * >+ * Licensed under the Apache License, Version 2.0 (the "License"); >+ * you may not use this file except in compliance with the License. >+ * You may obtain a copy of the License at >+ * >+ * http://www.apache.org/licenses/LICENSE-2.0 >+ * >+ * Unless required by applicable law or agreed to in writing, software >+ * distributed under the License is distributed on an "AS IS" BASIS, >+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. >+ * See the License for the specific language governing permissions and >+ * limitations under the License. >+ */ >+ >+package org.osgi.framework.wiring; >+ >+/** >+ * A wire connecting a {@link Capability} to a {@link Requirement}. >+ * >+ * @ThreadSafe >+ * @version $Id: 328ede0f8ddf3795594a8e0fc2cb11bbe7fa38fc $ >+ */ >+public interface Wire { >+ /** >+ * Returns the {@link Capability} for this wire. >+ * >+ * @return The {@link Capability} for this wire. >+ */ >+ Capability getCapability(); >+ >+ /** >+ * Return the {@link Requirement} for this wire. >+ * >+ * @return The {@link Requirement} for this wire. >+ */ >+ Requirement getRequirement(); >+ >+ /** >+ * Return the providing {@link Resource resource} of the {@link #getCapability() capability}. >+ * <p> >+ * The resource returned may differ from the resource referenced by the {@link #getCapability() >+ * capability}. >+ * @return the providing {@link Resource resource}. >+ */ >+ Resource getProvider(); >+ >+ /** >+ * Return the requiring {@link Resource resource} of the {@link #getRequirement() requirement}. >+ * <p> >+ * The resource returned my differ from the resource referenced by the {@link #getRequirement() >+ * requirement} >+ * @return the requiring {@link Resource resource}. >+ */ >+ Resource getRequirer(); >+} >Index: resolver/src/org/eclipse/osgi/internal/module/ResolverImpl.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/framework/bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/module/ResolverImpl.java,v >retrieving revision 1.112 >diff -u -r1.112 ResolverImpl.java >--- resolver/src/org/eclipse/osgi/internal/module/ResolverImpl.java 9 Jun 2011 20:08:44 -0000 1.112 >+++ resolver/src/org/eclipse/osgi/internal/module/ResolverImpl.java 20 Jun 2011 17:35:16 -0000 >@@ -1333,7 +1333,7 @@ > if (namespace == null) > capabilities = Collections.EMPTY_LIST; > else >- capabilities = name == null || "*".equals(name) ? namespace.getAllValues() : namespace.get(name); //$NON-NLS-1$ >+ capabilities = name == null || name.indexOf('*') >= 0 ? namespace.getAllValues() : namespace.get(name); > List<GenericCapability> candidates = new ArrayList<GenericCapability>(capabilities); > List<BundleCapability> genCapabilities = new ArrayList<BundleCapability>(candidates.size()); > // Must remove candidates that do not match before calling hooks. >Index: resolver/src/org/eclipse/osgi/internal/resolver/BaseDescriptionImpl.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/framework/bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/resolver/BaseDescriptionImpl.java,v >retrieving revision 1.12 >diff -u -r1.12 BaseDescriptionImpl.java >--- resolver/src/org/eclipse/osgi/internal/resolver/BaseDescriptionImpl.java 10 Jun 2011 14:13:25 -0000 1.12 >+++ resolver/src/org/eclipse/osgi/internal/resolver/BaseDescriptionImpl.java 20 Jun 2011 17:35:17 -0000 >@@ -156,5 +156,9 @@ > public String toString() { > return getNamespace() + BaseDescriptionImpl.toString(getAttributes(), false) + BaseDescriptionImpl.toString(getDirectives(), true); > } >+ >+ public BundleRevision getResource() { >+ return getRevision(); >+ } > } > } >Index: resolver/src/org/eclipse/osgi/internal/resolver/BundleDescriptionImpl.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/framework/bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/resolver/BundleDescriptionImpl.java,v >retrieving revision 1.68 >diff -u -r1.68 BundleDescriptionImpl.java >--- resolver/src/org/eclipse/osgi/internal/resolver/BundleDescriptionImpl.java 10 Jun 2011 14:13:25 -0000 1.68 >+++ resolver/src/org/eclipse/osgi/internal/resolver/BundleDescriptionImpl.java 20 Jun 2011 17:35:17 -0000 >@@ -1031,6 +1031,14 @@ > public String toString() { > return getRequirement() + " -> " + getCapability(); //$NON-NLS-1$ > } >+ >+ public BundleRevision getProvider() { >+ return getCapability().getRevision(); >+ } >+ >+ public BundleRevision getRequirer() { >+ return getRequirement().getRevision(); >+ } > } > > // Note that description wiring are identity equality based >@@ -1230,4 +1238,14 @@ > return BundleDescriptionImpl.this.toString(); > } > } >+ >+ @SuppressWarnings({"cast", "unchecked", "rawtypes"}) >+ public List<Capability> getCapabilities(String namespace) { >+ return (List<Capability>) (List) getDeclaredCapabilities(namespace); >+ } >+ >+ @SuppressWarnings({"cast", "unchecked", "rawtypes"}) >+ public List<Requirement> getRequirements(String namespace) { >+ return (List<Requirement>) (List) getDeclaredRequirements(namespace); >+ } > } >Index: resolver/src/org/eclipse/osgi/internal/resolver/StateBuilder.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/framework/bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/resolver/StateBuilder.java,v >retrieving revision 1.72 >diff -u -r1.72 StateBuilder.java >--- resolver/src/org/eclipse/osgi/internal/resolver/StateBuilder.java 10 Jun 2011 14:13:25 -0000 1.72 >+++ resolver/src/org/eclipse/osgi/internal/resolver/StateBuilder.java 20 Jun 2011 17:35:17 -0000 >@@ -19,6 +19,7 @@ > import org.eclipse.osgi.util.ManifestElement; > import org.eclipse.osgi.util.NLS; > import org.osgi.framework.*; >+import org.osgi.framework.wiring.ResourceConstants; > > /** > * This class builds bundle description objects from manifests >@@ -118,7 +119,7 @@ > result.setGenericRequires(createGenericRequires(genericRequires, osgiRequires)); > ManifestElement[] genericCapabilities = getGenericCapabilities(manifest, genericAliases); > ManifestElement[] osgiCapabilities = ManifestElement.parseHeader(Constants.PROVIDE_CAPABILITY, manifest.get(Constants.PROVIDE_CAPABILITY)); >- result.setGenericCapabilities(createGenericCapabilities(genericCapabilities, osgiCapabilities)); >+ result.setGenericCapabilities(createGenericCapabilities(genericCapabilities, osgiCapabilities, result)); > ManifestElement[] nativeCode = ManifestElement.parseHeader(Constants.BUNDLE_NATIVECODE, manifest.get(Constants.BUNDLE_NATIVECODE)); > result.setNativeCodeSpecification(createNativeCode(nativeCode)); > return result; >@@ -554,13 +555,24 @@ > return results; > } > >- private static GenericDescription[] createGenericCapabilities(ManifestElement[] equinoxCapabilities, ManifestElement[] osgiCapabilities) { >+ private static GenericDescription[] createGenericCapabilities(ManifestElement[] equinoxCapabilities, ManifestElement[] osgiCapabilities, BundleDescription description) throws BundleException { > List<GenericDescription> result = createEquinoxCapabilities(equinoxCapabilities); >- result = createOSGiCapabilities(osgiCapabilities, result); >+ result = createOSGiCapabilities(osgiCapabilities, result, description); > return result == null ? null : result.toArray(new GenericDescription[result.size()]); > } > >- static List<GenericDescription> createOSGiCapabilities(ManifestElement[] osgiCapabilities, List<GenericDescription> result) { >+ private static List<GenericDescription> createOSGiCapabilities(ManifestElement[] osgiCapabilities, List<GenericDescription> result, BundleDescription description) throws BundleException { >+ if (result == null) >+ result = new ArrayList<GenericDescription>(osgiCapabilities == null ? 1 : osgiCapabilities.length + 1); >+ // Always have an osgi.identity capability if there is a symbolic name. >+ GenericDescription osgiIdentity = createOsgiIdentityCapability(description); >+ if (osgiIdentity != null) >+ // always add the capability to the front >+ result.add(0, osgiIdentity); >+ return createOSGiCapabilities(osgiCapabilities, result); >+ } >+ >+ static List<GenericDescription> createOSGiCapabilities(ManifestElement[] osgiCapabilities, List<GenericDescription> result) throws BundleException { > if (osgiCapabilities == null) > return result; > if (result == null) >@@ -570,8 +582,12 @@ > String[] namespaces = element.getValueComponents(); > types: for (String namespace : namespaces) { > String effective = element.getDirective(Constants.EFFECTIVE_DIRECTIVE); >+ // Any declared osgi.identity capability with an effective directive value of "resolve" will be overridden. > if (effective != null && !Constants.EFFECTIVE_RESOLVE.equals(effective)) > break types; // ignore any namespace that is not effective at resolve time. >+ if (ResourceConstants.IDENTITY_NAMESPACE.equals(namespace)) >+ throw new BundleException("A bundle is not allowed to define a capability in the " + ResourceConstants.IDENTITY_NAMESPACE + " name space."); //$NON-NLS-1$ //$NON-NLS-2$ >+ > GenericDescriptionImpl desc = new GenericDescriptionImpl(); > desc.setType(namespace); > Map<String, Object> mapAttrs = getAttributes(element, new String[0]); >@@ -591,7 +607,7 @@ > return result; > } > >- private static List<GenericDescription> createEquinoxCapabilities(ManifestElement[] equinoxCapabilities) { >+ private static List<GenericDescription> createEquinoxCapabilities(ManifestElement[] equinoxCapabilities) throws BundleException { > if (equinoxCapabilities == null) > return null; > ArrayList<GenericDescription> results = new ArrayList<GenericDescription>(equinoxCapabilities.length); >@@ -604,6 +620,8 @@ > if (colonIdx > 0) { > name = genericNames[j].substring(0, colonIdx); > desc.setType(genericNames[j].substring(colonIdx + 1)); >+ if (ResourceConstants.IDENTITY_NAMESPACE.equals(desc.getType())) >+ throw new BundleException("A bundle is not allowed to define a capability in the " + ResourceConstants.IDENTITY_NAMESPACE + " name space."); //$NON-NLS-1$ //$NON-NLS-2$ > } > Map<String, Object> mapAttrs = getAttributes(equinoxCapabilities[i], new String[] {Constants.VERSION_ATTRIBUTE}); > Dictionary<String, Object> attrs = mapAttrs == null ? new Hashtable<String, Object>() : new Hashtable<String, Object>(mapAttrs); >@@ -748,4 +766,22 @@ > throw new BundleException(message + " : " + NLS.bind(StateMsg.HEADER_EXTENSION_ERROR, hostName), BundleException.MANIFEST_ERROR); //$NON-NLS-1$ > } > } >+ >+ private static GenericDescription createOsgiIdentityCapability(BundleDescription description) { >+ if (description.getSymbolicName() == null) >+ return null; >+ GenericDescriptionImpl result = new GenericDescriptionImpl(); >+ result.setType(ResourceConstants.IDENTITY_NAMESPACE); >+ Dictionary<String, Object> attributes = new Hashtable<String, Object>(); >+ attributes.put(ResourceConstants.IDENTITY_NAMESPACE, description.getSymbolicName()); >+ attributes.put(ResourceConstants.IDENTITY_TYPE_ATTRIBUTE, description.getHost() == null ? ResourceConstants.IDENTITY_TYPE_BUNDLE : ResourceConstants.IDENTITY_TYPE_FRAGMENT); >+ attributes.put(ResourceConstants.IDENTITY_VERSION_ATTRIBUTE, description.getVersion()); >+ result.setAttributes(attributes); >+ Map<String, String> directives = new HashMap<String, String>(); >+ directives.put(ResourceConstants.IDENTITY_SINGLETON_DIRECTIVE, String.valueOf(description.isSingleton())); >+ // The effective directive should be resolve >+ directives.put(ResourceConstants.CAPABILITY_EFFECTIVE_DIRECTIVE, ResourceConstants.EFFECTIVE_RESOLVE); >+ result.setDirectives(directives); >+ return result; >+ } > } >Index: resolver/src/org/eclipse/osgi/internal/resolver/StateImpl.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/framework/bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/resolver/StateImpl.java,v >retrieving revision 1.100 >diff -u -r1.100 StateImpl.java >--- resolver/src/org/eclipse/osgi/internal/resolver/StateImpl.java 9 Jun 2011 20:08:44 -0000 1.100 >+++ resolver/src/org/eclipse/osgi/internal/resolver/StateImpl.java 20 Jun 2011 17:35:17 -0000 >@@ -871,7 +871,11 @@ > } > > private void addSystemCapabilities(List<GenericDescription> capabilities, ManifestElement[] elements) { >- StateBuilder.createOSGiCapabilities(elements, capabilities); >+ try { >+ StateBuilder.createOSGiCapabilities(elements, capabilities); >+ } catch (BundleException e) { >+ throw new RuntimeException("Unexpected exception adding system capabilities.", e); //$NON-NLS-1$ >+ } > } > > @SuppressWarnings("rawtypes") >Index: resolver/src/org/eclipse/osgi/internal/resolver/VersionConstraintImpl.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/framework/bundles/org.eclipse.osgi/resolver/src/org/eclipse/osgi/internal/resolver/VersionConstraintImpl.java,v >retrieving revision 1.18 >diff -u -r1.18 VersionConstraintImpl.java >--- resolver/src/org/eclipse/osgi/internal/resolver/VersionConstraintImpl.java 10 Jun 2011 14:13:25 -0000 1.18 >+++ resolver/src/org/eclipse/osgi/internal/resolver/VersionConstraintImpl.java 20 Jun 2011 17:35:17 -0000 >@@ -156,6 +156,16 @@ > public String toString() { > return getNamespace() + BaseDescriptionImpl.toString(getAttributes(), false) + BaseDescriptionImpl.toString(getDirectives(), true); > } >+ >+ public boolean matches(Capability capability) { >+ if (!(capability instanceof BundleCapability)) >+ return false; >+ return matches((BundleCapability) capability); >+ } >+ >+ public BundleRevision getResource() { >+ return getRevision(); >+ } > } > > static StringBuffer addFilterAttributes(StringBuffer filter, Map<String, ?> attributes) { >#P org.eclipse.osgi.tests >Index: src/org/eclipse/osgi/tests/services/resolver/GenericCapabilityTest.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/framework/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/services/resolver/GenericCapabilityTest.java,v >retrieving revision 1.4 >diff -u -r1.4 GenericCapabilityTest.java >--- src/org/eclipse/osgi/tests/services/resolver/GenericCapabilityTest.java 27 Aug 2010 21:47:22 -0000 1.4 >+++ src/org/eclipse/osgi/tests/services/resolver/GenericCapabilityTest.java 20 Jun 2011 17:35:17 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2003, 2010 IBM Corporation and others. >+ * Copyright (c) 2003, 2011 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -10,8 +10,7 @@ > *******************************************************************************/ > package org.eclipse.osgi.tests.services.resolver; > >-import java.util.Dictionary; >-import java.util.Hashtable; >+import java.util.*; > import junit.framework.Test; > import junit.framework.TestSuite; > import org.eclipse.osgi.service.resolver.*; >@@ -19,8 +18,8 @@ > import org.osgi.framework.Constants; > > public class GenericCapabilityTest extends AbstractStateTest { >- private static final String GENERIC_REQUIRE = "Eclipse-GenericRequire"; //$NON-NLS-1$ >- private static final String GENERIC_CAPABILITY = "Eclipse-GenericCapability"; //$NON-NLS-1$ >+ static final String GENERIC_REQUIRE = "Eclipse-GenericRequire"; //$NON-NLS-1$ >+ static final String GENERIC_CAPABILITY = "Eclipse-GenericCapability"; //$NON-NLS-1$ > > public static Test suite() { > return new TestSuite(GenericCapabilityTest.class); >@@ -35,7 +34,7 @@ > Hashtable manifest = new Hashtable(); > long bundleID = 0; > manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); >- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "genericCapablity"); >+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "genericCapability"); > manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); > StringBuffer capabililty = new StringBuffer(); > capabililty.append("foo; version=\"1.3.1\"; attr1=\"value1\"; attr2=\"value2\","); >@@ -55,6 +54,7 @@ > manifest.put(Constants.BUNDLE_SYMBOLICNAME, "genericRequire"); > manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); > StringBuffer required = new StringBuffer(); >+ required.append("genericCapability:osgi.identity; selection-filter=\"(version=1.0)\","); > required.append("foo; selection-filter=\"(version>=1.3.0)\","); > required.append("bar:bartype; selection-filter=\"(attr1=value1)\","); > required.append("test.types:testtype; selection-filter=\"(&(aVersion>=2.0.0)(aLong>=5555)(aDouble>=1.00)(aUri=file:/test)(aSet=c)(aString=someString))\""); >@@ -68,13 +68,15 @@ > assertTrue("1.0", genCap.isResolved()); > assertTrue("1.1", genReq.isResolved()); > GenericSpecification[] genSpecs = genReq.getGenericRequires(); >- assertTrue("2.0", genSpecs.length == 3); >+ assertTrue("2.0", genSpecs.length == 4); > assertTrue("2.1", genSpecs[0].isResolved()); > assertEquals("2.1.1", genSpecs[0].getSupplier(), genCap.getGenericCapabilities()[0]); > assertTrue("2.2", genSpecs[1].isResolved()); > assertEquals("2.2.1", genSpecs[1].getSupplier(), genCap.getGenericCapabilities()[1]); > assertTrue("2.3", genSpecs[2].isResolved()); > assertEquals("2.3.1", genSpecs[2].getSupplier(), genCap.getGenericCapabilities()[2]); >+ assertTrue("2.4", genSpecs[3].isResolved()); >+ assertEquals("2.4.1", genSpecs[3].getSupplier(), genCap.getGenericCapabilities()[3]); > } > > public void testGenericsUpdate() throws BundleException { >@@ -82,7 +84,7 @@ > Hashtable manifest = new Hashtable(); > long bundleID = 0; > manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); >- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "genericCapablity"); >+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "genericCapability"); > manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); > StringBuffer capabililty = new StringBuffer(); > capabililty.append("foo; version=\"1.3.1\"; attr1=\"value1\"; attr2=\"value2\","); >@@ -102,6 +104,7 @@ > manifest.put(Constants.BUNDLE_SYMBOLICNAME, "genericRequire"); > manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); > StringBuffer required = new StringBuffer(); >+ required.append("genericCapability:osgi.identity; selection-filter=\"(version>=1.0)\","); > required.append("foo; selection-filter=\"(version>=1.3.0)\","); > required.append("bar:bartype; selection-filter=\"(attr1=value1)\","); > required.append("test.types:testtype; selection-filter=\"(&(aVersion>=2.0.0)(aLong>=5555)(aDouble>=1.00)(aUri=file:/test)(aSet=c)(aString=someString))\""); >@@ -115,17 +118,19 @@ > assertTrue("1.0", genCap.isResolved()); > assertTrue("1.1", genReq.isResolved()); > GenericSpecification[] genSpecs = genReq.getGenericRequires(); >- assertTrue("2.0", genSpecs.length == 3); >+ assertTrue("2.0", genSpecs.length == 4); > assertTrue("2.1", genSpecs[0].isResolved()); > assertEquals("2.1.1", genSpecs[0].getSupplier(), genCap.getGenericCapabilities()[0]); > assertTrue("2.2", genSpecs[1].isResolved()); > assertEquals("2.2.1", genSpecs[1].getSupplier(), genCap.getGenericCapabilities()[1]); > assertTrue("2.3", genSpecs[2].isResolved()); > assertEquals("2.3.1", genSpecs[2].getSupplier(), genCap.getGenericCapabilities()[2]); >+ assertTrue("2.4", genSpecs[3].isResolved()); >+ assertEquals("2.4.1", genSpecs[3].getSupplier(), genCap.getGenericCapabilities()[3]); > > manifest.clear(); > manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); >- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "genericCapablity"); >+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "genericCapability"); > manifest.put(Constants.BUNDLE_VERSION, "2.0.0"); > capabililty = new StringBuffer(); > capabililty.append("foo; version=\"1.3.2\"; attr1=\"value1\"; attr2=\"value2\","); >@@ -146,13 +151,15 @@ > assertTrue("3.0", genCap2.isResolved()); > assertTrue("3.1", genReq.isResolved()); > genSpecs = genReq.getGenericRequires(); >- assertTrue("4.0", genSpecs.length == 3); >+ assertTrue("4.0", genSpecs.length == 4); > assertTrue("4.1", genSpecs[0].isResolved()); > assertEquals("4.1.1", genSpecs[0].getSupplier(), genCap2.getGenericCapabilities()[0]); > assertTrue("4.2", genSpecs[1].isResolved()); > assertEquals("4.2.1", genSpecs[1].getSupplier(), genCap2.getGenericCapabilities()[1]); > assertTrue("4.3", genSpecs[2].isResolved()); > assertEquals("4.3.1", genSpecs[2].getSupplier(), genCap2.getGenericCapabilities()[2]); >+ assertTrue("4.4", genSpecs[3].isResolved()); >+ assertEquals("4.4.1", genSpecs[3].getSupplier(), genCap2.getGenericCapabilities()[3]); > > } > >@@ -161,7 +168,7 @@ > Hashtable manifest = new Hashtable(); > long bundleID = 0; > manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); >- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "genericCapablity"); >+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "genericCapability"); > manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); > StringBuffer capabililty = new StringBuffer(); > capabililty.append("foo; version=\"1.3.1\"; attr1=\"value1\"; attr2=\"value2\","); >@@ -181,6 +188,7 @@ > manifest.put(Constants.BUNDLE_SYMBOLICNAME, "genericRequire"); > manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); > StringBuffer required = new StringBuffer(); >+ required.append("genericCapability:osgi.identity; selection-filter=\"(version>=1.0)\","); > required.append("foo; selection-filter=\"(version>=1.3.0)\","); > required.append("bar:bartype; selection-filter=\"(attr1=value1)\","); > required.append("test.types:testtype; selection-filter=\"(&(aVersion>=2.0.0)(aLong>=5555)(aDouble>=1.00)(aUri=file:/test)(aSet=c)(aString=someString))\""); >@@ -194,26 +202,30 @@ > assertTrue("1.0", genCap.isResolved()); > assertTrue("1.1", genReq.isResolved()); > GenericSpecification[] genSpecs = genReq.getGenericRequires(); >- assertTrue("2.0", genSpecs.length == 3); >+ assertTrue("2.0", genSpecs.length == 4); > assertTrue("2.1", genSpecs[0].isResolved()); > assertEquals("2.1.1", genSpecs[0].getSupplier(), genCap.getGenericCapabilities()[0]); > assertTrue("2.2", genSpecs[1].isResolved()); > assertEquals("2.2.1", genSpecs[1].getSupplier(), genCap.getGenericCapabilities()[1]); > assertTrue("2.3", genSpecs[2].isResolved()); > assertEquals("2.3.1", genSpecs[2].getSupplier(), genCap.getGenericCapabilities()[2]); >+ assertTrue("2.4", genSpecs[3].isResolved()); >+ assertEquals("2.4.1", genSpecs[3].getSupplier(), genCap.getGenericCapabilities()[3]); > > state.resolve(new BundleDescription[] {genCap}); > > assertTrue("3.0", genCap.isResolved()); > assertTrue("3.1", genReq.isResolved()); > genSpecs = genReq.getGenericRequires(); >- assertTrue("4.0", genSpecs.length == 3); >+ assertTrue("4.0", genSpecs.length == 4); > assertTrue("4.1", genSpecs[0].isResolved()); > assertEquals("4.1.1", genSpecs[0].getSupplier(), genCap.getGenericCapabilities()[0]); > assertTrue("4.2", genSpecs[1].isResolved()); > assertEquals("4.2.1", genSpecs[1].getSupplier(), genCap.getGenericCapabilities()[1]); > assertTrue("4.3", genSpecs[2].isResolved()); > assertEquals("4.3.1", genSpecs[2].getSupplier(), genCap.getGenericCapabilities()[2]); >+ assertTrue("4.4", genSpecs[3].isResolved()); >+ assertEquals("4.4.1", genSpecs[3].getSupplier(), genCap.getGenericCapabilities()[3]); > > } > >@@ -223,7 +235,7 @@ > long bundleID = 0; > > manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); >- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "genericCapablity"); >+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "genericCapability"); > manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); > StringBuffer capabililty = new StringBuffer(); > capabililty.append("foo; version=\"1.3.1\"; attr1=\"value1\"; attr2=\"value2\","); >@@ -241,7 +253,7 @@ > manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); > manifest.put(Constants.BUNDLE_SYMBOLICNAME, "genericCapability.frag1"); > manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); >- manifest.put(Constants.FRAGMENT_HOST, "genericCapablity;bundle-version=\"[1.0.0,2.0.0)\""); >+ manifest.put(Constants.FRAGMENT_HOST, "genericCapability;bundle-version=\"[1.0.0,2.0.0)\""); > capabililty = new StringBuffer(); > capabililty.append("fragmentStuff"); > manifest.put(GENERIC_CAPABILITY, capabililty.toString()); >@@ -252,9 +264,11 @@ > manifest.put(Constants.BUNDLE_SYMBOLICNAME, "genericRequire"); > manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); > StringBuffer required = new StringBuffer(); >+ required.append("genericCapability:osgi.identity; selection-filter=\"(&(version=1.0.0)(type=osgi.bundle))\","); > required.append("foo; selection-filter=\"(version>=1.3.0)\","); > required.append("bar:bartype; selection-filter=\"(attr1=value1)\","); > required.append("test.types:testtype; selection-filter=\"(&(aVersion>=2.0.0)(aLong>=5555)(aDouble>=1.00)(aUri=file:/test)(aSet=c)(aString=someString))\","); >+ required.append("genericCapability.frag1:osgi.identity; selection-filter=\"(&(version=1.0.0)(type=osgi.fragment))\","); > required.append("fragmentStuff"); > manifest.put(GENERIC_REQUIRE, required.toString()); > BundleDescription genReq = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME), bundleID++); >@@ -269,8 +283,8 @@ > assertTrue("1.2", genCapFrag.isResolved()); > GenericSpecification[] genSpecs = genReq.getGenericRequires(); > GenericDescription[] selectedCapabilities = genCap.getSelectedGenericCapabilities(); >- assertTrue("2.0", genSpecs.length == 4); >- assertEquals("Wrong number of selected capabilities", 4, selectedCapabilities.length); >+ assertTrue("2.0", genSpecs.length == 6); >+ assertEquals("Wrong number of selected capabilities", 6, selectedCapabilities.length); > assertTrue("2.1", genSpecs[0].isResolved()); > assertEquals("2.1.1", genSpecs[0].getSupplier(), selectedCapabilities[0]); > assertTrue("2.2", genSpecs[1].isResolved()); >@@ -279,6 +293,10 @@ > assertEquals("2.3.1", genSpecs[2].getSupplier(), selectedCapabilities[2]); > assertTrue("2.4", genSpecs[3].isResolved()); > assertEquals("2.4.1", genSpecs[3].getSupplier(), selectedCapabilities[3]); >+ assertTrue("2.5", genSpecs[4].isResolved()); >+ assertEquals("2.5.1", genSpecs[4].getSupplier(), selectedCapabilities[4]); >+ assertTrue("2.6", genSpecs[5].isResolved()); >+ assertEquals("2.6.1", genSpecs[5].getSupplier(), selectedCapabilities[5]); > } > > public void testGenericsIntraFrags() throws BundleException { >@@ -304,7 +322,12 @@ > manifest.put(Constants.BUNDLE_SYMBOLICNAME, "org.eclipse.equinox.generic.frag.b"); > manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); > manifest.put(Constants.FRAGMENT_HOST, "org.eclipse.equinox.generic.host;bundle-version=\"1.0.0\""); >- manifest.put("Eclipse-GenericRequire", "frag.a"); >+ StringBuffer required = new StringBuffer(); >+ required.append("org.eclipse.equinox.generic.host:osgi.identity; selection-filter=\"(&(version=1.0.0)(type=osgi.bundle))\","); >+ required.append("frag.a,"); >+ required.append("org.eclipse.equinox.generic.frag.a:osgi.identity; selection-filter=\"(&(version=1.0.0)(type=osgi.fragment))\","); >+ required.append("org.eclipse.equinox.generic.frag.b:osgi.identity; selection-filter=\"(&(version=1.0.0)(type=osgi.fragment))\""); >+ manifest.put(GENERIC_REQUIRE, required.toString()); > BundleDescription genFragB = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME), bundleID++); > > state.addBundle(genHost); >@@ -317,10 +340,13 @@ > assertTrue("1.2", genFragB.isResolved()); > GenericSpecification[] genSpecs = genFragB.getGenericRequires(); > GenericDescription[] selected = genHost.getSelectedGenericCapabilities(); >- assertEquals("Wrong number of selected", 1, selected.length); >- assertTrue("2.0", genSpecs.length == 1); >- assertTrue("2.1", genSpecs[0].isResolved()); >- assertEquals("2.1.1", genSpecs[0].getSupplier(), selected[0]); >+ assertEquals("Wrong number of selected", 1 + 3, selected.length); // + 3 for host frabA and fragB osgi.identity cap >+ assertTrue("2.0", genSpecs.length == 4); >+ Collection providedCollection = new ArrayList(Arrays.asList(selected)); >+ for (int i = 0; i < genSpecs.length; i++) { >+ assertTrue("2.1." + i, genSpecs[i].isResolved()); >+ assertTrue("Wrong provider for requirement: " + genSpecs[i], providedCollection.remove(genSpecs[i].getSupplier())); >+ } > } > > public void testGenericsAliases() throws BundleException { >@@ -333,7 +359,7 @@ > Hashtable manifest = new Hashtable(); > long bundleID = 0; > manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); >- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "genericCapablity"); >+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "genericCapability"); > manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); > manifest.put(Constants.EXPORT_SERVICE, "org.osgi.service.log.LogService; version=1.2"); > manifest.put("TJW-Export", "my.great.stuff; aLong:long=5150; aDouble:double=3.14; aVersion:version=1.2.0"); >@@ -345,6 +371,7 @@ > manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); > manifest.put(Constants.IMPORT_SERVICE, "org.osgi.service.log.LogService; selection-filter=(version>=1.0.0)"); > manifest.put("TJW-Import", "my.great.stuff; selection-filter=(&(aLong<=10000)(aLong>=5000))"); >+ manifest.put(GENERIC_REQUIRE, "genericCapability:osgi.identity; selection-filter=\"(&(version=1.0.0)(type=osgi.bundle))\""); > BundleDescription genReq = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME), bundleID++); > > state.addBundle(genCap); >@@ -354,11 +381,13 @@ > assertTrue("1.0", genCap.isResolved()); > assertTrue("1.1", genReq.isResolved()); > GenericSpecification[] genSpecs = genReq.getGenericRequires(); >- assertTrue("2.0", genSpecs.length == 2); >+ assertTrue("2.0", genSpecs.length == 3); > assertTrue("2.1", genSpecs[0].isResolved()); >- assertEquals("2.1.1", genSpecs[0].getSupplier(), genCap.getGenericCapabilities()[0]); >+ assertEquals("2.1.1", genSpecs[0].getSupplier(), genCap.getGenericCapabilities()[1]); > assertTrue("2.2", genSpecs[1].isResolved()); >- assertEquals("2.2.1", genSpecs[1].getSupplier(), genCap.getGenericCapabilities()[1]); >+ assertEquals("2.2.1", genSpecs[1].getSupplier(), genCap.getGenericCapabilities()[2]); >+ assertTrue("2.3", genSpecs[2].isResolved()); >+ assertEquals("2.3.1", genSpecs[2].getSupplier(), genCap.getGenericCapabilities()[0]); > } > > public void testGenericsOptionalMultiple() throws BundleException { >@@ -366,7 +395,7 @@ > Hashtable manifest = new Hashtable(); > long bundleID = 0; > manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); >- manifest.put(Constants.BUNDLE_SYMBOLICNAME, "genericCapablity"); >+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "genericCapability"); > manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); > StringBuffer capabililty = new StringBuffer(); > capabililty.append("foo; version=\"1.3.1\"; attr1=\"value1\"; attr2=\"value2\","); >@@ -389,6 +418,7 @@ > manifest.put(Constants.BUNDLE_SYMBOLICNAME, "genericRequire"); > manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); > StringBuffer required = new StringBuffer(); >+ required.append("genericCapability:osgi.identity; selection-filter=\"(&(version=1.0.0)(type=osgi.bundle))\","); > required.append("foo; selection-filter=\"(version>=1.3.0)\","); > required.append("bar:bartype; selection-filter=\"(attr1=value1)\","); > required.append("test.types:testtype; selection-filter=\"(&(aVersion>=2.0.0)(aLong>=5555)(aDouble>=1.00)(aUri=file:/test)(aSet=c)(aString=someString))\","); >@@ -405,21 +435,23 @@ > assertTrue("1.0", genCap.isResolved()); > assertTrue("1.1", genReq.isResolved()); > GenericSpecification[] genSpecs = genReq.getGenericRequires(); >- assertTrue("2.0", genSpecs.length == 6); >+ assertTrue("2.0", genSpecs.length == 7); > assertTrue("2.1", genSpecs[0].isResolved()); > assertEquals("2.1.1", genSpecs[0].getSupplier(), genCap.getGenericCapabilities()[0]); > assertTrue("2.2", genSpecs[1].isResolved()); > assertEquals("2.2.1", genSpecs[1].getSupplier(), genCap.getGenericCapabilities()[1]); > assertTrue("2.3", genSpecs[2].isResolved()); > assertEquals("2.3.1", genSpecs[2].getSupplier(), genCap.getGenericCapabilities()[2]); >- assertFalse("2.4", genSpecs[3].isResolved()); >- assertTrue("2.5", genSpecs[4].isResolved()); >- assertEquals("2.5.1", genSpecs[4].getSupplier(), genCap.getGenericCapabilities()[3]); >- assertTrue("2.6", genSpecs[5].isResolved()); >- GenericDescription[] suppliers = genSpecs[5].getSuppliers(); >+ assertTrue("2.3", genSpecs[3].isResolved()); >+ assertEquals("2.3.1", genSpecs[3].getSupplier(), genCap.getGenericCapabilities()[3]); >+ assertFalse("2.4", genSpecs[4].isResolved()); >+ assertTrue("2.5", genSpecs[5].isResolved()); >+ assertEquals("2.5.1", genSpecs[5].getSupplier(), genCap.getGenericCapabilities()[4]); >+ assertTrue("2.6", genSpecs[6].isResolved()); >+ GenericDescription[] suppliers = genSpecs[6].getSuppliers(); > assertTrue("2.6.1", suppliers != null && suppliers.length == 2); >- assertEquals("2.6.2", suppliers[0], genCap.getGenericCapabilities()[5]); >- assertEquals("2.6.3", suppliers[1], genCap.getGenericCapabilities()[4]); >+ assertEquals("2.6.2", suppliers[0], genCap.getGenericCapabilities()[6]); >+ assertEquals("2.6.3", suppliers[1], genCap.getGenericCapabilities()[5]); > } > > public void testGenericsCycles() throws BundleException { >@@ -481,18 +513,18 @@ > GenericSpecification[] genSpecs = genReq.getGenericRequires(); > GenericDescription[] selected = genCap.getSelectedGenericCapabilities(); > assertTrue("2.0", genSpecs.length == 4); >- assertEquals("Wrong number of selected", 4, selected.length); >+ assertEquals("Wrong number of selected", 4 + 2, selected.length); // + 2 for host and frag osgi.identity caps > assertTrue("2.1", genSpecs[0].isResolved()); >- assertEquals("2.1.1", genSpecs[0].getSupplier(), selected[0]); >+ assertEquals("2.1.1", genSpecs[0].getSupplier(), selected[1]); > assertTrue("2.2", genSpecs[1].isResolved()); >- assertEquals("2.2.1", genSpecs[1].getSupplier(), selected[1]); >+ assertEquals("2.2.1", genSpecs[1].getSupplier(), selected[2]); > assertTrue("2.3", genSpecs[2].isResolved()); >- assertEquals("2.3.1", genSpecs[2].getSupplier(), selected[2]); >+ assertEquals("2.3.1", genSpecs[2].getSupplier(), selected[3]); > assertTrue("2.4", genSpecs[3].isResolved()); >- assertEquals("2.4.1", genSpecs[3].getSupplier(), selected[3]); >+ assertEquals("2.4.1", genSpecs[3].getSupplier(), selected[5]); > genSpecs = genCap.getGenericRequires(); > assertTrue("3.0", genSpecs.length == 1); > assertTrue("3.1", genSpecs[0].isResolved()); >- assertEquals("3.1.1", genSpecs[0].getSupplier(), genReq.getGenericCapabilities()[0]); >+ assertEquals("3.1.1", genSpecs[0].getSupplier(), genReq.getGenericCapabilities()[1]); > } > } >Index: src/org/eclipse/osgi/tests/services/resolver/OSGiCapabilityTest.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/framework/bundles/org.eclipse.osgi.tests/src/org/eclipse/osgi/tests/services/resolver/OSGiCapabilityTest.java,v >retrieving revision 1.4 >diff -u -r1.4 OSGiCapabilityTest.java >--- src/org/eclipse/osgi/tests/services/resolver/OSGiCapabilityTest.java 10 Sep 2010 21:07:21 -0000 1.4 >+++ src/org/eclipse/osgi/tests/services/resolver/OSGiCapabilityTest.java 20 Jun 2011 17:35:17 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2010 IBM Corporation and others. >+ * Copyright (c) 2010, 2011 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -13,7 +13,7 @@ > import java.io.File; > import java.io.IOException; > import java.net.URL; >-import java.util.Dictionary; >+import java.util.*; > import junit.framework.Test; > import junit.framework.TestSuite; > import org.eclipse.osgi.framework.util.Headers; >@@ -105,9 +105,9 @@ > assertTrue("c2", c2.isResolved()); > assertTrue("c3", c3.isResolved()); > >- checkGenericBasics(3, c1.getResolvedGenericRequires(), p1.getSelectedGenericCapabilities()); >- checkGenericBasics(3, c2.getResolvedGenericRequires(), p2.getSelectedGenericCapabilities()); >- checkGenericBasics(3, c3.getResolvedGenericRequires(), p3.getSelectedGenericCapabilities()); >+ checkGenericBasics(4, c1.getResolvedGenericRequires(), p1.getSelectedGenericCapabilities()); >+ checkGenericBasics(4, c2.getResolvedGenericRequires(), p2.getSelectedGenericCapabilities()); >+ checkGenericBasics(4, c3.getResolvedGenericRequires(), p3.getSelectedGenericCapabilities()); > > File stateDir = getContext().getDataFile(getName()); //$NON-NLS-1$ > stateDir.mkdirs(); >@@ -130,16 +130,17 @@ > assertTrue("c2", c2.isResolved()); > assertTrue("c3", c3.isResolved()); > >- checkGenericBasics(3, c1.getResolvedGenericRequires(), p1.getSelectedGenericCapabilities()); >- checkGenericBasics(3, c2.getResolvedGenericRequires(), p2.getSelectedGenericCapabilities()); >- checkGenericBasics(3, c3.getResolvedGenericRequires(), p3.getSelectedGenericCapabilities()); >+ checkGenericBasics(4, c1.getResolvedGenericRequires(), p1.getSelectedGenericCapabilities()); >+ checkGenericBasics(4, c2.getResolvedGenericRequires(), p2.getSelectedGenericCapabilities()); >+ checkGenericBasics(4, c3.getResolvedGenericRequires(), p3.getSelectedGenericCapabilities()); > } > > private void checkGenericBasics(int expectedCnt, GenericDescription[] genRequired, GenericDescription[] genProvided) { > assertEquals("Expected number of capabilities do not match", expectedCnt, genRequired.length); > assertEquals("Specs do not match Descs", genRequired.length, genProvided.length); >+ Collection providedCollection = new ArrayList(Arrays.asList(genProvided)); > for (int i = 0; i < genRequired.length; i++) { >- assertEquals("Wrong provider for requirement.", genProvided[i], genRequired[i]); >+ assertTrue("Wrong provider for requirement: " + genRequired[i], providedCollection.remove(genRequired[i])); > } > } > >@@ -172,7 +173,7 @@ > assertTrue("c1Frag", c1Frag.isResolved()); > assertTrue("p4", p4.isResolved()); > >- checkGenericBasics(4, c1.getResolvedGenericRequires(), p1.getSelectedGenericCapabilities()); >+ checkGenericBasics(6, c1.getResolvedGenericRequires(), p1.getSelectedGenericCapabilities()); > > File stateDir = getContext().getDataFile(getName()); //$NON-NLS-1$ > stateDir.mkdirs(); >@@ -194,7 +195,7 @@ > assertTrue("c1Frag", c1Frag.isResolved()); > assertTrue("p4", p4.isResolved()); > >- checkGenericBasics(4, c1.getResolvedGenericRequires(), p1.getSelectedGenericCapabilities()); >+ checkGenericBasics(6, c1.getResolvedGenericRequires(), p1.getSelectedGenericCapabilities()); > > state.setResolver(platformAdmin.createResolver()); > state.resolve(new BundleDescription[] {p1}); >@@ -205,7 +206,7 @@ > assertTrue("c1Frag", c1Frag.isResolved()); > assertTrue("p4", p4.isResolved()); > >- checkGenericBasics(4, c1.getResolvedGenericRequires(), p1.getSelectedGenericCapabilities()); >+ checkGenericBasics(6, c1.getResolvedGenericRequires(), p1.getSelectedGenericCapabilities()); > } > > public void testGenericFragments02() throws BundleException { >@@ -233,7 +234,7 @@ > assertTrue("c1", c1.isResolved()); > assertFalse("c1Frag", c1Frag.isResolved()); > >- checkGenericBasics(3, c1.getResolvedGenericRequires(), p1.getSelectedGenericCapabilities()); >+ checkGenericBasics(4, c1.getResolvedGenericRequires(), p1.getSelectedGenericCapabilities()); > > File stateDir = getContext().getDataFile(getName() + 1); //$NON-NLS-1$ > stateDir.mkdirs(); >@@ -253,7 +254,7 @@ > assertTrue("c1", c1.isResolved()); > assertFalse("c1Frag", c1Frag.isResolved()); > >- checkGenericBasics(3, c1.getResolvedGenericRequires(), p1.getSelectedGenericCapabilities()); >+ checkGenericBasics(4, c1.getResolvedGenericRequires(), p1.getSelectedGenericCapabilities()); > > manifest = loadManifest("p4.osgi.MF"); > BundleDescription p4 = state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME), bundleID++); >@@ -267,7 +268,7 @@ > assertTrue("c1Frag", c1Frag.isResolved()); > assertTrue("p4", p4.isResolved()); > >- checkGenericBasics(4, c1.getResolvedGenericRequires(), p1.getSelectedGenericCapabilities()); >+ checkGenericBasics(6, c1.getResolvedGenericRequires(), p1.getSelectedGenericCapabilities()); > > stateDir = getContext().getDataFile(getName() + 2); //$NON-NLS-1$ > stateDir.mkdirs(); >@@ -288,7 +289,7 @@ > assertTrue("c1Frag", c1Frag.isResolved()); > assertTrue("p4", p4.isResolved()); > >- checkGenericBasics(4, c1.getResolvedGenericRequires(), p1.getSelectedGenericCapabilities()); >+ checkGenericBasics(6, c1.getResolvedGenericRequires(), p1.getSelectedGenericCapabilities()); > } > > public void testGenericUses() throws BundleException { >@@ -362,6 +363,34 @@ > checkUsedCapability(c4v130, p5v100Capability); > } > >+ public void testDeclaringIdentityCapability() throws BundleException { >+ State state = buildEmptyState(); >+ Hashtable manifest = new Hashtable(); >+ long bundleID = 0; >+ manifest.put(Constants.BUNDLE_MANIFESTVERSION, "2"); >+ manifest.put(Constants.BUNDLE_SYMBOLICNAME, "genericCapability"); >+ manifest.put(Constants.BUNDLE_VERSION, "1.0.0"); >+ StringBuffer capabililty = new StringBuffer(); >+ capabililty.append("testFailure:osgi.identity; test=failure"); >+ manifest.put(GenericCapabilityTest.GENERIC_CAPABILITY, capabililty.toString()); >+ >+ try { >+ state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME), bundleID++); >+ fail("Expected failure to create description that specifies osgi.identity capability"); >+ } catch (BundleException e) { >+ // expected >+ } >+ >+ manifest.remove(GenericCapabilityTest.GENERIC_CAPABILITY); >+ manifest.put(Constants.PROVIDE_CAPABILITY, "osgi.identity; osgi.identity=testFailure; test=failure"); >+ try { >+ state.getFactory().createBundleDescription(state, manifest, (String) manifest.get(Constants.BUNDLE_SYMBOLICNAME), bundleID++); >+ fail("Expected failure to create description that specifies osgi.identity capability"); >+ } catch (BundleException e) { >+ // expected >+ } >+ } >+ > private void checkUsedImports(BundleDescription importer, ExportPackageDescription[] expectedPackages) { > ExportPackageDescription[] imported = importer.getResolvedImports(); > assertEquals("Wrong number of imports for bundle: " + importer, expectedPackages.length, imported.length); >@@ -381,8 +410,9 @@ > private void checkUsedCapability(BundleDescription requirer, GenericDescription[] expectedCapabilities) { > GenericDescription[] required = requirer.getResolvedGenericRequires(); > assertEquals("Wrong number of capabilities for bundle: " + requirer, expectedCapabilities.length, required.length); >+ Collection providedCollection = new ArrayList(Arrays.asList(expectedCapabilities)); > for (int i = 0; i < required.length; i++) { >- assertEquals("Wrong required capability from bundle: " + requirer, expectedCapabilities[i], required[i]); >+ assertTrue("Wrong provider for requirement: " + required[i], providedCollection.remove(required[i])); > } > } > } >Index: test_files/genericCapability/c1.equinox.MF >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/framework/bundles/org.eclipse.osgi.tests/test_files/genericCapability/c1.equinox.MF,v >retrieving revision 1.1 >diff -u -r1.1 c1.equinox.MF >--- test_files/genericCapability/c1.equinox.MF 25 Aug 2010 21:43:59 -0000 1.1 >+++ test_files/genericCapability/c1.equinox.MF 20 Jun 2011 17:35:17 -0000 >@@ -17,4 +17,6 @@ > selection-filter="(&(rank>=100)(!(rank>=200)) > (percent>=0.1)(!(percent>=0.2)) > (test.version>=1.0)(!(test.version>=2.0)) >- (test.string~=abc))" >+ (test.string~=abc))", >+ *:osgi.identity; >+ selection-filter="(&(osgi.identity=p1.*)(version=1.0)(type=osgi.bundle))" >Index: test_files/genericCapability/c1.equinox.name.MF >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/framework/bundles/org.eclipse.osgi.tests/test_files/genericCapability/c1.equinox.name.MF,v >retrieving revision 1.1 >diff -u -r1.1 c1.equinox.name.MF >--- test_files/genericCapability/c1.equinox.name.MF 25 Aug 2010 21:43:59 -0000 1.1 >+++ test_files/genericCapability/c1.equinox.name.MF 20 Jun 2011 17:35:17 -0000 >@@ -17,4 +17,6 @@ > selection-filter="(&(rank>=100)(!(rank>=200)) > (percent>=0.1)(!(percent>=0.2)) > (test.version>=1.0)(!(test.version>=2.0)) >- (test.string~=abc))" >+ (test.string~=abc))", >+ p1.*:osgi.identity; >+ selection-filter="(&(version=1.0)(type=osgi.bundle))" >Index: test_files/genericCapability/c1.osgi.MF >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/framework/bundles/org.eclipse.osgi.tests/test_files/genericCapability/c1.osgi.MF,v >retrieving revision 1.3 >diff -u -r1.3 c1.osgi.MF >--- test_files/genericCapability/c1.osgi.MF 1 Feb 2011 20:47:33 -0000 1.3 >+++ test_files/genericCapability/c1.osgi.MF 20 Jun 2011 17:35:17 -0000 >@@ -17,4 +17,6 @@ > filter:="(&(rank>=100)(!(rank>=200)) > (percent>=0.1)(!(percent>=0.2)) > (test.version>=1.0)(!(test.version>=2.0)) >- (test.string~=abc))" >+ (test.string~=abc))", >+ osgi.identity; >+ filter:="(&(osgi.identity=p1.*)(version=1.0)(type=osgi.bundle))" >Index: test_files/genericCapability/c1.osgi.frag.MF >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/framework/bundles/org.eclipse.osgi.tests/test_files/genericCapability/c1.osgi.frag.MF,v >retrieving revision 1.3 >diff -u -r1.3 c1.osgi.frag.MF >--- test_files/genericCapability/c1.osgi.frag.MF 1 Feb 2011 20:47:33 -0000 1.3 >+++ test_files/genericCapability/c1.osgi.frag.MF 20 Jun 2011 17:35:17 -0000 >@@ -8,4 +8,6 @@ > filter:="(&(rank>=100)(!(rank>=200)) > (percent>=0.1)(!(percent>=0.2)) > (test.version>=1.0)(!(test.version>=2.0)) >- (test.string~=abc))" >+ (test.string~=abc))", >+ osgi.identity; >+ filter:="(&(osgi.identity=p1.*.frag)(version=1.0)(type=osgi.fragment))" >Index: test_files/genericCapability/c2.equinox.MF >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/framework/bundles/org.eclipse.osgi.tests/test_files/genericCapability/c2.equinox.MF,v >retrieving revision 1.1 >diff -u -r1.1 c2.equinox.MF >--- test_files/genericCapability/c2.equinox.MF 25 Aug 2010 21:43:59 -0000 1.1 >+++ test_files/genericCapability/c2.equinox.MF 20 Jun 2011 17:35:17 -0000 >@@ -17,4 +17,6 @@ > selection-filter="(&(rank>=200)(!(rank>=300)) > (percent>=0.2)(!(percent>=0.3)) > (test.version>=2.0)(!(test.version>=3.0)) >- (test.string~=abc))" >+ (test.string~=abc))", >+ *:osgi.identity; >+ selection-filter="(&(osgi.identity=p2.*)(version=1.0)(type=osgi.bundle))" >Index: test_files/genericCapability/c2.equinox.name.MF >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/framework/bundles/org.eclipse.osgi.tests/test_files/genericCapability/c2.equinox.name.MF,v >retrieving revision 1.1 >diff -u -r1.1 c2.equinox.name.MF >--- test_files/genericCapability/c2.equinox.name.MF 25 Aug 2010 21:43:59 -0000 1.1 >+++ test_files/genericCapability/c2.equinox.name.MF 20 Jun 2011 17:35:17 -0000 >@@ -17,4 +17,6 @@ > selection-filter="(&(rank>=200)(!(rank>=300)) > (percent>=0.2)(!(percent>=0.3)) > (test.version>=2.0)(!(test.version>=3.0)) >- (test.string~=abc))" >+ (test.string~=abc))", >+ p2.*:osgi.identity; >+ selection-filter="(&(version=1.0)(type=osgi.bundle))" >Index: test_files/genericCapability/c2.osgi.MF >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/framework/bundles/org.eclipse.osgi.tests/test_files/genericCapability/c2.osgi.MF,v >retrieving revision 1.3 >diff -u -r1.3 c2.osgi.MF >--- test_files/genericCapability/c2.osgi.MF 1 Feb 2011 20:47:33 -0000 1.3 >+++ test_files/genericCapability/c2.osgi.MF 20 Jun 2011 17:35:17 -0000 >@@ -17,4 +17,6 @@ > filter:="(&(rank>=200)(!(rank>=300)) > (percent>=0.2)(!(percent>=0.3)) > (test.version>=2.0)(!(test.version>=3.0)) >- (test.string~=abc))" >+ (test.string~=abc))", >+ osgi.identity; >+ filter:="(&(osgi.identity=p2.*)(version=1.0)(type=osgi.bundle))" >Index: test_files/genericCapability/c3.equinox.MF >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/framework/bundles/org.eclipse.osgi.tests/test_files/genericCapability/c3.equinox.MF,v >retrieving revision 1.1 >diff -u -r1.1 c3.equinox.MF >--- test_files/genericCapability/c3.equinox.MF 25 Aug 2010 21:43:59 -0000 1.1 >+++ test_files/genericCapability/c3.equinox.MF 20 Jun 2011 17:35:17 -0000 >@@ -17,4 +17,6 @@ > selection-filter="(&(rank>=300)(!(rank>=400)) > (percent>=0.3)(!(percent>=0.4)) > (test.version>=3.0)(!(test.version>=4.0)) >- (test.string~=abc))" >+ (test.string~=abc))", >+ *:osgi.identity; >+ selection-filter="(&(osgi.identity=p3.*)(version=1.0)(type=osgi.bundle))" >Index: test_files/genericCapability/c3.equinox.name.MF >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/framework/bundles/org.eclipse.osgi.tests/test_files/genericCapability/c3.equinox.name.MF,v >retrieving revision 1.1 >diff -u -r1.1 c3.equinox.name.MF >--- test_files/genericCapability/c3.equinox.name.MF 25 Aug 2010 21:43:59 -0000 1.1 >+++ test_files/genericCapability/c3.equinox.name.MF 20 Jun 2011 17:35:17 -0000 >@@ -17,4 +17,6 @@ > selection-filter="(&(rank>=300)(!(rank>=400)) > (percent>=0.3)(!(percent>=0.4)) > (test.version>=3.0)(!(test.version>=4.0)) >- (test.string~=abc))" >+ (test.string~=abc))", >+ p3.*:osgi.identity; >+ selection-filter="(&(version=1.0)(type=osgi.bundle))" >Index: test_files/genericCapability/c3.osgi.MF >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/framework/bundles/org.eclipse.osgi.tests/test_files/genericCapability/c3.osgi.MF,v >retrieving revision 1.3 >diff -u -r1.3 c3.osgi.MF >--- test_files/genericCapability/c3.osgi.MF 1 Feb 2011 20:47:33 -0000 1.3 >+++ test_files/genericCapability/c3.osgi.MF 20 Jun 2011 17:35:17 -0000 >@@ -17,4 +17,6 @@ > filter:="(&(rank>=300)(!(rank>=400)) > (percent>=0.3)(!(percent>=0.4)) > (test.version>=3.0)(!(test.version>=4.0)) >- (test.string~=abc))" >+ (test.string~=abc))", >+ osgi.identity; >+ filter:="(&(osgi.identity=p3.*)(version=1.0)(type=osgi.bundle))" >Index: test_files/genericCapability/c4.v100.osgi.MF >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/framework/bundles/org.eclipse.osgi.tests/test_files/genericCapability/c4.v100.osgi.MF,v >retrieving revision 1.2 >diff -u -r1.2 c4.v100.osgi.MF >--- test_files/genericCapability/c4.v100.osgi.MF 1 Feb 2011 20:47:33 -0000 1.2 >+++ test_files/genericCapability/c4.v100.osgi.MF 20 Jun 2011 17:35:17 -0000 >@@ -3,5 +3,6 @@ > Bundle-SymbolicName: c4.osgi > Bundle-Version: 1.0 > Require-Capability: >- namespace.5; filter:="(version=1.0)" >+ namespace.5; filter:="(version=1.0)", >+ osgi.identity; filter:="(&(osgi.identity=p5.osgi)(version=1.0)(type=osgi.bundle))" > Import-Package: p6, p7 >Index: test_files/genericCapability/c4.v110.osgi.MF >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/framework/bundles/org.eclipse.osgi.tests/test_files/genericCapability/c4.v110.osgi.MF,v >retrieving revision 1.2 >diff -u -r1.2 c4.v110.osgi.MF >--- test_files/genericCapability/c4.v110.osgi.MF 1 Feb 2011 20:47:33 -0000 1.2 >+++ test_files/genericCapability/c4.v110.osgi.MF 20 Jun 2011 17:35:17 -0000 >@@ -3,5 +3,6 @@ > Bundle-SymbolicName: c4.osgi > Bundle-Version: 1.1 > Require-Capability: >- namespace.5; filter:="(namespace.5=test)" >+ namespace.5; filter:="(namespace.5=test)", >+ osgi.identity; filter:="(&(osgi.identity=p5.osgi)(version=1.0)(type=osgi.bundle))" > Import-Package: p6; p7; version="[1.0,1.1)" >Index: test_files/genericCapability/c4.v120.osgi.MF >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/framework/bundles/org.eclipse.osgi.tests/test_files/genericCapability/c4.v120.osgi.MF,v >retrieving revision 1.2 >diff -u -r1.2 c4.v120.osgi.MF >--- test_files/genericCapability/c4.v120.osgi.MF 1 Feb 2011 20:47:33 -0000 1.2 >+++ test_files/genericCapability/c4.v120.osgi.MF 20 Jun 2011 17:35:17 -0000 >@@ -3,5 +3,6 @@ > Bundle-SymbolicName: c4.osgi > Bundle-Version: 1.2 > Require-Capability: >- namespace.5; filter:="(version=1.0)" >+ namespace.5; filter:="(version=1.0)", >+ osgi.identity; filter:="(&(osgi.identity=p5.osgi)(version=1.0)(type=osgi.bundle))" > DynamicImport-Package: p6, p7 >Index: test_files/genericCapability/c4.v130.osgi.MF >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.equinox/framework/bundles/org.eclipse.osgi.tests/test_files/genericCapability/c4.v130.osgi.MF,v >retrieving revision 1.2 >diff -u -r1.2 c4.v130.osgi.MF >--- test_files/genericCapability/c4.v130.osgi.MF 1 Feb 2011 20:47:33 -0000 1.2 >+++ test_files/genericCapability/c4.v130.osgi.MF 20 Jun 2011 17:35:17 -0000 >@@ -3,5 +3,6 @@ > Bundle-SymbolicName: c4.osgi > Bundle-Version: 1.3 > Require-Capability: >- namespace.5; filter:="(version=1.0)" >+ namespace.5; filter:="(version=1.0)", >+ osgi.identity; filter:="(&(osgi.identity=p5.osgi)(version=1.0)(type=osgi.bundle))" > Require-Bundle: p6.osgi, p7.osgi
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 349618
:
198155
|
198209
|
198272
|
198420
|
198779
|
198857
|
198921
|
199140
|
199146