diff --git a/org.osgi.framework/src/org/osgi/framework/BundleContext.java b/org.osgi.framework/src/org/osgi/framework/BundleContext.java index ae2f2ebc7f..0b60f6a581 100644 --- a/org.osgi.framework/src/org/osgi/framework/BundleContext.java +++ b/org.osgi.framework/src/org/osgi/framework/BundleContext.java @@ -530,12 +530,10 @@ public interface BundleContext extends BundleReference { * expression, and the packages for the class names under which the services * were registered match the context bundle's packages as defined in * {@link ServiceReference#isAssignableTo(Bundle, String)}. - * *
* The list is valid at the time of the call to this method. However since * the Framework is a very dynamic environment, services can be modified or * unregistered at any time. - * *
* The specified {@code filter} expression is used to select the registered * services whose service properties contain keys and values which satisfy @@ -545,7 +543,6 @@ public interface BundleContext extends BundleReference { * {@code filter} expression cannot be parsed, an * {@link InvalidSyntaxException} will be thrown with a human readable * message where the filter became unparsable. - * *
* The result is an array of {@code ServiceReference} objects for all * services that meet all of the following conditions: @@ -567,12 +564,14 @@ public interface BundleContext extends BundleReference { * * * @param clazz The class name with which the service was registered or - * {@code null} for all services. + * {@code null} for all services. * @param filter The filter expression or {@code null} for all services. * @return An array of {@code ServiceReference} objects or {@code null} if - * no services are registered which satisfy the search. + * no services are registered which satisfy the search. There is no + * guarantee that the {@code ServiceReference} objects in the array + * will be in any specific order. * @throws InvalidSyntaxException If the specified {@code filter} contains - * an invalid filter expression that cannot be parsed. + * an invalid filter expression that cannot be parsed. * @throws IllegalStateException If this BundleContext is no longer valid. */ ServiceReference>[] getServiceReferences(String clazz, String filter) throws InvalidSyntaxException; @@ -582,12 +581,10 @@ public interface BundleContext extends BundleReference { * of {@code ServiceReference} objects contains services that were * registered under the specified class and match the specified filter * expression. - * *
* The list is valid at the time of the call to this method. However since * the Framework is a very dynamic environment, services can be modified or * unregistered at any time. - * *
* The specified {@code filter} expression is used to select the registered * services whose service properties contain keys and values which satisfy @@ -597,7 +594,6 @@ public interface BundleContext extends BundleReference { * {@code filter} expression cannot be parsed, an * {@link InvalidSyntaxException} will be thrown with a human readable * message where the filter became unparsable. - * *
* The result is an array of {@code ServiceReference} objects for all * services that meet all of the following conditions: @@ -615,12 +611,14 @@ public interface BundleContext extends BundleReference { * * * @param clazz The class name with which the service was registered or - * {@code null} for all services. + * {@code null} for all services. * @param filter The filter expression or {@code null} for all services. * @return An array of {@code ServiceReference} objects or {@code null} if - * no services are registered which satisfy the search. + * no services are registered which satisfy the search. There is no + * guarantee that the {@code ServiceReference} objects in the array + * will be in any specific order. * @throws InvalidSyntaxException If the specified {@code filter} contains - * an invalid filter expression that cannot be parsed. + * an invalid filter expression that cannot be parsed. * @throws IllegalStateException If this BundleContext is no longer valid. * @since 1.3 */ @@ -629,12 +627,10 @@ public interface BundleContext extends BundleReference { /** * Returns a {@code ServiceReference} object for a service that implements * and was registered under the specified class. - * *
* The returned {@code ServiceReference} object is valid at the time of the * call to this method. However as the Framework is a very dynamic * environment, services can be modified or unregistered at any time. - * *
* This method is the same as calling * {@link #getServiceReferences(String, String)} with a {@code null} filter @@ -642,14 +638,8 @@ public interface BundleContext extends BundleReference { * is provided as a convenience for when the caller is interested in any * service that implements the specified class. *
- * If multiple such services exist, the service with the highest priority is - * selected. This priority is defined as the service reference with the - * highest ranking (as specified in its {@link Constants#SERVICE_RANKING} - * property) is returned. - *
- * If there is a tie in ranking, the service with the lowest service id (as - * specified in its {@link Constants#SERVICE_ID} property); that is, the - * service that was registered first is returned. + * If multiple such services exist, the service that is first in the + * {@link ServiceReference#compareTo(Object) ranking order} is returned. * * @param clazz The class name with which the service was registered. * @return A {@code ServiceReference} object, or {@code null} if no services @@ -662,28 +652,22 @@ public interface BundleContext extends BundleReference { /** * Returns a {@code ServiceReference} object for a service that implements * and was registered under the name of the specified class. - * *
* The returned {@code ServiceReference} object is valid at the time of the * call to this method. However as the Framework is a very dynamic * environment, services can be modified or unregistered at any time. - * *
* This method is the same as calling * {@link #getServiceReferences(Class, String)} with a {@code null} filter * expression. It is provided as a convenience for when the caller is * interested in any service that implements the specified class. *
- * If multiple such services exist, the service with the highest ranking (as - * specified in its {@link Constants#SERVICE_RANKING} property) is returned. - *
- * If there is a tie in ranking, the service with the lowest service id (as
- * specified in its {@link Constants#SERVICE_ID} property); that is, the
- * service that was registered first is returned.
+ * If multiple such services exist, the service that is first in the
+ * {@link ServiceReference#compareTo(Object) ranking order} is returned.
*
* @param Type of Service.
* @param clazz The class under whose name the service was registered. Must
- * not be {@code null}.
+ * not be {@code null}.
* @return A {@code ServiceReference} object, or {@code null} if no services
* are registered which implement the specified class.
* @throws IllegalStateException If this BundleContext is no longer valid.
@@ -699,12 +683,10 @@ public interface BundleContext extends BundleReference {
* specified filter expression, and the packages for the class names under
* which the services were registered match the context bundle's packages as
* defined in {@link ServiceReference#isAssignableTo(Bundle, String)}.
- *
*
* The collection is valid at the time of the call to this method. However * since the Framework is a very dynamic environment, services can be * modified or unregistered at any time. - * *
* The specified {@code filter} expression is used to select the registered * services whose service properties contain keys and values which satisfy @@ -714,7 +696,6 @@ public interface BundleContext extends BundleReference { * {@code filter} expression cannot be parsed, an * {@link InvalidSyntaxException} will be thrown with a human readable * message where the filter became unparsable. - * *
* The result is a collection of {@code ServiceReference} objects for all
* services that meet all of the following conditions:
@@ -736,12 +717,14 @@ public interface BundleContext extends BundleReference {
*
* @param Type of Service
* @param clazz The class under whose name the service was registered. Must
- * not be {@code null}.
+ * not be {@code null}.
* @param filter The filter expression or {@code null} for all services.
* @return A collection of {@code ServiceReference} objects. May be empty if
- * no services are registered which satisfy the search.
+ * no services are registered which satisfy the search. There is no
+ * guarantee that the {@code ServiceReference} objects in the
+ * collection will be in any specific order.
* @throws InvalidSyntaxException If the specified {@code filter} contains
- * an invalid filter expression that cannot be parsed.
+ * an invalid filter expression that cannot be parsed.
* @throws IllegalStateException If this BundleContext is no longer valid.
* @since 1.6
*/
diff --git a/org.osgi.framework/src/org/osgi/framework/ServiceReference.java b/org.osgi.framework/src/org/osgi/framework/ServiceReference.java
index d37a0144ab..59dc892c53 100644
--- a/org.osgi.framework/src/org/osgi/framework/ServiceReference.java
+++ b/org.osgi.framework/src/org/osgi/framework/ServiceReference.java
@@ -171,7 +171,8 @@ public interface ServiceReference
/**
* Compares this {@code ServiceReference} with the specified
* {@code ServiceReference} for order.
- *
+ *
+ * Natural Order *
* If this {@code ServiceReference} and the specified
* {@code ServiceReference} have the same {@link Constants#SERVICE_ID
@@ -184,15 +185,31 @@ public interface ServiceReference
* {@code ServiceReference} is less than the specified
* {@code ServiceReference} if it has a higher {@link Constants#SERVICE_ID
* service id} and greater if it has a lower service id.
+ *
+ * Sorting a collection of {@code ServiceReference} objects with natural + * order will result in the first element having the lowest + * {@link Constants#SERVICE_RANKING service ranking} and the last element + * having the highest {@link Constants#SERVICE_RANKING service ranking}. + *
+ * Ranking Order + *
+ * Ranking order, as defined in the Core Specification, is the + * reverse of natural order. + *
+ * Sorting a collection of {@code ServiceReference} objects with ranking + * order will result in the first element having the highest + * {@link Constants#SERVICE_RANKING service ranking} and the last element + * having the lowest {@link Constants#SERVICE_RANKING service ranking}. * * @param reference The {@code ServiceReference} to be compared. * @return Returns a negative integer, zero, or a positive integer if this * {@code ServiceReference} is less than, equal to, or greater than * the specified {@code ServiceReference}. * @throws IllegalArgumentException If the specified - * {@code ServiceReference} was not created by the same framework - * instance as this {@code ServiceReference}. + * {@code ServiceReference} was not created by the same + * framework instance as this {@code ServiceReference}. * @since 1.4 + * @see "Core Specification, Service Ranking Order" */ @Override public int compareTo(Object reference); diff --git a/org.osgi.framework/src/org/osgi/framework/hooks/resolver/ResolverHook.java b/org.osgi.framework/src/org/osgi/framework/hooks/resolver/ResolverHook.java index 889582c116..518572ccbe 100644 --- a/org.osgi.framework/src/org/osgi/framework/hooks/resolver/ResolverHook.java +++ b/org.osgi.framework/src/org/osgi/framework/hooks/resolver/ResolverHook.java @@ -22,6 +22,7 @@ import org.osgi.annotation.versioning.ConsumerType; import org.osgi.framework.Bundle; +import org.osgi.framework.ServiceReference; import org.osgi.framework.namespace.BundleNamespace; import org.osgi.framework.namespace.IdentityNamespace; import org.osgi.framework.wiring.BundleCapability; @@ -32,7 +33,6 @@ /** * OSGi Framework Resolver Hook instances are obtained from the OSGi * {@link ResolverHookFactory Framework Resolver Hook Factory} service. - * *
* A Resolver Hook instance is called by the framework during a resolve process. * A resolver hook may influence the outcome of a resolve process by removing @@ -41,7 +41,6 @@ * supports all remove operations. Any other attempts to modify a shrinkable * collection will result in an {@code UnsupportedOperationException} being * thrown. - * *
* The following steps outline the way a framework uses the resolver hooks * during a resolve process. @@ -60,7 +59,6 @@ * {@link ResolverHookFactory#begin(Collection)} method to inform the hooks * about a resolve process beginning and to obtain a Resolver Hook instance that * will be used for the duration of the resolve process. - * *
* Resolver hooks are low level. Implementations of the resolver hook must be * careful not to create an unresolvable state which is very hard for a diff --git a/org.osgi.framework/src/org/osgi/framework/hooks/resolver/package-info.java b/org.osgi.framework/src/org/osgi/framework/hooks/resolver/package-info.java index c390a2c7db..66aeb0b21c 100644 --- a/org.osgi.framework/src/org/osgi/framework/hooks/resolver/package-info.java +++ b/org.osgi.framework/src/org/osgi/framework/hooks/resolver/package-info.java @@ -31,7 +31,7 @@ * @author $Id$ */ -@Version("1.0") +@Version("1.0.1") package org.osgi.framework.hooks.resolver; import org.osgi.annotation.versioning.Version; diff --git a/org.osgi.service.component/src/org/osgi/service/component/ComponentContext.java b/org.osgi.service.component/src/org/osgi/service/component/ComponentContext.java index 7e3189b45d..59359269e0 100644 --- a/org.osgi.service.component/src/org/osgi/service/component/ComponentContext.java +++ b/org.osgi.service.component/src/org/osgi/service/component/ComponentContext.java @@ -49,22 +49,19 @@ public interface ComponentContext { /** * Returns the service object for the specified reference name. - * *
* If the cardinality of the reference is {@code 0..n} or {@code 1..n} and
- * multiple services are bound to the reference, the service with the
- * highest ranking (as specified in its {@code Constants.SERVICE_RANKING}
- * property) is returned. If there is a tie in ranking, the service with the
- * lowest service id (as specified in its {@code Constants.SERVICE_ID}
- * property); that is, the service that was registered first is returned.
+ * multiple services are bound to the reference, the service whose
+ * {@code ServiceReference} is first in the ranking order is returned. See
+ * {@code ServiceReference.compareTo(Object)}.
*
* @param name The name of a reference as specified in a {@code reference}
- * element in this component's description.
+ * element in this component's description.
* @return A service object for the referenced service or {@code null} if
* the reference cardinality is {@code 0..1} or {@code 0..n} and no
* bound service is available.
* @throws ComponentException If Service Component Runtime catches an
- * exception while activating the bound service.
+ * exception while activating the bound service.
*/
public S locateService(String name);
@@ -90,14 +87,16 @@ public interface ComponentContext {
* Returns the service objects for the specified reference name.
*
* @param name The name of a reference as specified in a {@code reference}
- * element in this component's description.
+ * element in this component's description.
* @return An array of service objects for the referenced service or
* {@code null} if the reference cardinality is {@code 0..1} or
* {@code 0..n} and no bound service is available. If the reference
* cardinality is {@code 0..1} or {@code 1..1} and a bound service
- * is available, the array will have exactly one element.
+ * is available, the array will have exactly one element. There is
+ * no guarantee that the service objects in the array will be in any
+ * specific order.
* @throws ComponentException If Service Component Runtime catches an
- * exception while activating a bound service.
+ * exception while activating a bound service.
*/
public Object[] locateServices(String name);
diff --git a/org.osgi.service.component/src/org/osgi/service/component/annotations/CollectionType.java b/org.osgi.service.component/src/org/osgi/service/component/annotations/CollectionType.java
index e1c84ac125..c74db1029e 100644
--- a/org.osgi.service.component/src/org/osgi/service/component/annotations/CollectionType.java
+++ b/org.osgi.service.component/src/org/osgi/service/component/annotations/CollectionType.java
@@ -51,9 +51,9 @@ public enum CollectionType {
* services.
*
* The Maps must implement {@code Comparable} with the {@code compareTo} - * method comparing service property maps using the same ordering as - * {@code ServiceReference.compareTo} based upon service ranking and service - * id. + * method comparing service property maps using an ordering which is the + * same as the natural ordering of {@code ServiceReference}s as specified in + * {@code ServiceReference.compareTo}. */ PROPERTIES("properties"), @@ -64,9 +64,10 @@ public enum CollectionType { * {@link #PROPERTIES}, and whose value is the bound service object. *
* The Map.Entries must implement {@code Comparable} with the - * {@code compareTo} method comparing service property maps using the same - * ordering as {@code ServiceReference.compareTo} based upon service ranking - * and service id. + * {@code compareTo} method comparing service property maps using an + * ordering which is the same as the natural ordering of + * {@code ServiceReference}s as specified in + * {@code ServiceReference.compareTo}. */ TUPLE("tuple"); diff --git a/org.osgi.service.component/src/org/osgi/service/component/annotations/package-info.java b/org.osgi.service.component/src/org/osgi/service/component/annotations/package-info.java index ecc433e7fa..cf90c20cd1 100644 --- a/org.osgi.service.component/src/org/osgi/service/component/annotations/package-info.java +++ b/org.osgi.service.component/src/org/osgi/service/component/annotations/package-info.java @@ -25,7 +25,7 @@ * @author $Id$ */ -@Version(COMPONENT_SPECIFICATION_VERSION) +@Version(COMPONENT_SPECIFICATION_VERSION + ".1") package org.osgi.service.component.annotations; import static org.osgi.service.component.ComponentConstants.COMPONENT_SPECIFICATION_VERSION; diff --git a/org.osgi.service.component/src/org/osgi/service/component/package-info.java b/org.osgi.service.component/src/org/osgi/service/component/package-info.java index ed90142c55..2379b1dce2 100644 --- a/org.osgi.service.component/src/org/osgi/service/component/package-info.java +++ b/org.osgi.service.component/src/org/osgi/service/component/package-info.java @@ -35,7 +35,7 @@ * @author $Id$ */ -@Version(COMPONENT_SPECIFICATION_VERSION) +@Version(COMPONENT_SPECIFICATION_VERSION + ".1") package org.osgi.service.component; import static org.osgi.service.component.ComponentConstants.COMPONENT_SPECIFICATION_VERSION; diff --git a/org.osgi.service.http.whiteboard/src/org/osgi/service/http/context/ServletContextHelper.java b/org.osgi.service.http.whiteboard/src/org/osgi/service/http/context/ServletContextHelper.java index ccca49378f..b1080e8c42 100644 --- a/org.osgi.service.http.whiteboard/src/org/osgi/service/http/context/ServletContextHelper.java +++ b/org.osgi.service.http.whiteboard/src/org/osgi/service/http/context/ServletContextHelper.java @@ -34,30 +34,27 @@ /** * Helper service for a servlet context used by a Http Whiteboard implementation * to serve HTTP requests. - * *
* This service defines methods that the Http Whiteboard implementation may call * to get information for a request when dealing with whiteboard services. - * *
* Each {@code ServletContextHelper} is registered with a * {@link HttpWhiteboardConstants#HTTP_WHITEBOARD_CONTEXT_NAME * "osgi.http.whiteboard.context.name"} service property containing a name to * reference by servlets, servlet filters, resources, and listeners. If there is * more than one {@code ServletContextHelper} registered with the same context - * name, the one with the highest service ranking is active, the others are - * inactive. - * + * name, the one that is first in the + * {@link org.osgi.framework.ServiceReference#compareTo(Object) ranking order} + * is active, the others are inactive. *
* A context is registered with the * {@link HttpWhiteboardConstants#HTTP_WHITEBOARD_CONTEXT_PATH * "osgi.http.whiteboard.context.path"} service property to define a path under * which all services registered with this context are reachable. If there is * more than one {@code ServletContextHelper} registered with the same path, - * each duplicate context path is searched by service ranking order according to - * {@link org.osgi.framework.ServiceReference#compareTo(Object)} until a - * matching servlet or resource is found. - * + * each duplicate context path is searched in + * {@link org.osgi.framework.ServiceReference#compareTo(Object) ranking order} + * until a matching servlet or resource is found. *
* Servlets, servlet filters, resources, and listeners services may be * associated with a {@code ServletContextHelper} service with the @@ -66,23 +63,21 @@ * {@code ServletContextHelper} service does not exist or is currently not * active, the whiteboard services for that {@code ServletContextHelper} are not * active either. - * *
* If no {@code ServletContextHelper} service is associated, that is no * {@link HttpWhiteboardConstants#HTTP_WHITEBOARD_CONTEXT_SELECT * "osgi.http.whiteboard.context.select"} service property is configured for a * whiteboard service, a default {@code ServletContextHelper} is used. - * *
* Those whiteboard services that are associated with the same * {@code ServletContextHelper} object will share the same * {@code ServletContext} object. - * *
* The behavior of the methods on the default {@code ServletContextHelper} is * defined as follows: *
- * For example, a service with the same service properties but a higher - * service ranking. + * For example, another service with the same service properties but having + * a higher service ranking. See + * {@link org.osgi.framework.ServiceReference#compareTo(Object)}. */ public static final int FAILURE_REASON_SHADOWED_BY_OTHER_SERVICE = 3; diff --git a/org.osgi.service.http.whiteboard/src/org/osgi/service/http/runtime/dto/package-info.java b/org.osgi.service.http.whiteboard/src/org/osgi/service/http/runtime/dto/package-info.java index a4559c03b6..ad5c469578 100644 --- a/org.osgi.service.http.whiteboard/src/org/osgi/service/http/runtime/dto/package-info.java +++ b/org.osgi.service.http.whiteboard/src/org/osgi/service/http/runtime/dto/package-info.java @@ -35,7 +35,7 @@ * @author $Id$ */ -@Version(HTTP_WHITEBOARD_SPECIFICATION_VERSION + ".0") +@Version(HTTP_WHITEBOARD_SPECIFICATION_VERSION + ".1") package org.osgi.service.http.runtime.dto; import static org.osgi.service.http.whiteboard.HttpWhiteboardConstants.HTTP_WHITEBOARD_SPECIFICATION_VERSION; diff --git a/org.osgi.service.http.whiteboard/src/org/osgi/service/http/whiteboard/Preprocessor.java b/org.osgi.service.http.whiteboard/src/org/osgi/service/http/whiteboard/Preprocessor.java index 5f0ef75b6a..2e23a38f53 100644 --- a/org.osgi.service.http.whiteboard/src/org/osgi/service/http/whiteboard/Preprocessor.java +++ b/org.osgi.service.http.whiteboard/src/org/osgi/service/http/whiteboard/Preprocessor.java @@ -26,10 +26,9 @@ * Services registered as a {@code Preprocessor} using a whiteboard pattern are * executed for every request before the dispatching is performed. *
- * If there are several services of this type, they are run in order of their - * service ranking, the one with the highest ranking is used first. In the case - * of a service ranking tie, the service with the lowest service id is processed - * first. + * If there are several services of this type, they are run in + * {@link org.osgi.framework.ServiceReference#compareTo(Object) ranking order}, + * the one with the highest ranking is used first. *
* The preprocessor is handled in the same way as filters. When a preprocessor * is put into service {@link Filter#init(javax.servlet.FilterConfig)} is diff --git a/org.osgi.service.http.whiteboard/src/org/osgi/service/http/whiteboard/package-info.java b/org.osgi.service.http.whiteboard/src/org/osgi/service/http/whiteboard/package-info.java index 0433e91e19..e46233b315 100644 --- a/org.osgi.service.http.whiteboard/src/org/osgi/service/http/whiteboard/package-info.java +++ b/org.osgi.service.http.whiteboard/src/org/osgi/service/http/whiteboard/package-info.java @@ -35,7 +35,7 @@ * @author $Id$ */ -@Version(HTTP_WHITEBOARD_SPECIFICATION_VERSION + ".1") +@Version(HTTP_WHITEBOARD_SPECIFICATION_VERSION + ".2") package org.osgi.service.http.whiteboard; import static org.osgi.service.http.whiteboard.HttpWhiteboardConstants.HTTP_WHITEBOARD_SPECIFICATION_VERSION; diff --git a/org.osgi.service.jaxrs/src/org/osgi/service/jaxrs/runtime/dto/DTOConstants.java b/org.osgi.service.jaxrs/src/org/osgi/service/jaxrs/runtime/dto/DTOConstants.java index fa5927a60f..056a696b55 100644 --- a/org.osgi.service.jaxrs/src/org/osgi/service/jaxrs/runtime/dto/DTOConstants.java +++ b/org.osgi.service.jaxrs/src/org/osgi/service/jaxrs/runtime/dto/DTOConstants.java @@ -37,8 +37,9 @@ private DTOConstants() { /** * Service is shadowed by another service. *
- * For example, a service with the same service properties but a higher
- * service ranking.
+ * For example, another service with the same service properties but having
+ * a higher service ranking. See
+ * {@link org.osgi.framework.ServiceReference#compareTo(Object)}.
*/
public static final int FAILURE_REASON_SHADOWED_BY_OTHER_SERVICE = 1;
diff --git a/org.osgi.service.jaxrs/src/org/osgi/service/jaxrs/runtime/dto/package-info.java b/org.osgi.service.jaxrs/src/org/osgi/service/jaxrs/runtime/dto/package-info.java
index 0c0fab8895..28ae9ff063 100644
--- a/org.osgi.service.jaxrs/src/org/osgi/service/jaxrs/runtime/dto/package-info.java
+++ b/org.osgi.service.jaxrs/src/org/osgi/service/jaxrs/runtime/dto/package-info.java
@@ -35,7 +35,7 @@
* @author $Id$
*/
-@Version(JAX_RS_WHITEBOARD_SPECIFICATION_VERSION + ".0")
+@Version(JAX_RS_WHITEBOARD_SPECIFICATION_VERSION + ".1")
package org.osgi.service.jaxrs.runtime.dto;
import static org.osgi.service.jaxrs.whiteboard.JaxrsWhiteboardConstants.JAX_RS_WHITEBOARD_SPECIFICATION_VERSION;
diff --git a/org.osgi.service.jaxrs/src/org/osgi/service/jaxrs/whiteboard/package-info.java b/org.osgi.service.jaxrs/src/org/osgi/service/jaxrs/whiteboard/package-info.java
index 5da2d783e5..72127e120d 100644
--- a/org.osgi.service.jaxrs/src/org/osgi/service/jaxrs/whiteboard/package-info.java
+++ b/org.osgi.service.jaxrs/src/org/osgi/service/jaxrs/whiteboard/package-info.java
@@ -35,7 +35,7 @@
* @author $Id$
*/
-@Version(JAX_RS_WHITEBOARD_SPECIFICATION_VERSION + ".1")
+@Version(JAX_RS_WHITEBOARD_SPECIFICATION_VERSION + ".2")
package org.osgi.service.jaxrs.whiteboard;
import static org.osgi.service.jaxrs.whiteboard.JaxrsWhiteboardConstants.JAX_RS_WHITEBOARD_SPECIFICATION_VERSION;
diff --git a/org.osgi.util.tracker/src/org/osgi/util/tracker/ServiceTracker.java b/org.osgi.util.tracker/src/org/osgi/util/tracker/ServiceTracker.java
index 67bfe046ad..c872213110 100644
--- a/org.osgi.util.tracker/src/org/osgi/util/tracker/ServiceTracker.java
+++ b/org.osgi.util.tracker/src/org/osgi/util/tracker/ServiceTracker.java
@@ -544,15 +544,11 @@ public ServiceReference[] getServiceReferences() {
/**
* Returns a {@code ServiceReference} for one of the services being tracked
* by this {@code ServiceTracker}.
- *
*
- * If multiple services are being tracked, the service with the highest - * ranking (as specified in its {@code service.ranking} property) is - * returned. If there is a tie in ranking, the service with the lowest - * service id (as specified in its {@code service.id} property); that is, - * the service that was registered first is returned. This is the same - * algorithm used by {@code BundleContext.getServiceReference}. - * + * If multiple services are being tracked, the service that is first in the + * {@link ServiceReference#compareTo(Object) ranking order} is returned. + * This is the same algorithm used by + * {@code BundleContext.getServiceReference}. *
* This implementation calls {@link #getServiceReferences()} to get the list
* of references for the tracked services.
@@ -775,9 +771,8 @@ void modified() {
/**
* Return a {@code SortedMap} of the {@code ServiceReference}s and service
* objects for all services being tracked by this {@code ServiceTracker}.
- * The map is sorted in reverse natural order of {@code ServiceReference}.
- * That is, the first entry is the service with the highest ranking and the
- * lowest service id.
+ * The map is sorted in {@link ServiceReference#compareTo(Object) ranking
+ * order}.
*
* @return A {@code SortedMap} with the {@code ServiceReference}s and
* service objects for all services being tracked by this
diff --git a/org.osgi.util.tracker/src/org/osgi/util/tracker/package-info.java b/org.osgi.util.tracker/src/org/osgi/util/tracker/package-info.java
index 525c871316..1dc0c9a45a 100644
--- a/org.osgi.util.tracker/src/org/osgi/util/tracker/package-info.java
+++ b/org.osgi.util.tracker/src/org/osgi/util/tracker/package-info.java
@@ -31,7 +31,7 @@
* @author $Id$
*/
-@Version("1.5.4")
+@Version("1.5.5")
package org.osgi.util.tracker;
import org.osgi.annotation.versioning.Version;
diff --git a/osgi.specs/docbook/112/service.component.xml b/osgi.specs/docbook/112/service.component.xml
index 35a3ff2a74..6e4b1e7204 100644
--- a/osgi.specs/docbook/112/service.component.xml
+++ b/osgi.specs/docbook/112/service.component.xml
@@ -731,9 +731,9 @@
Map
- An unmodifiable Map containing the service
properties of the bound service. This Map must additionally
implement Comparable
with the compareTo
- method comparing service property maps using the same ordering as
- ServiceReference.compareTo
based upon service ranking
- and service id.ServiceReference
s
+ as specified in ServiceReference.compareTo
.
@@ -943,9 +943,9 @@
Map
- An unmodifiable Map containing the service
properties of the bound service. This Map must additionally
implement Comparable
with the compareTo
- method comparing service property maps using the same ordering as
- ServiceReference.compareTo
based upon service ranking
- and service id.ServiceReference
s
+ as specified in ServiceReference.compareTo
.
Comparable
with the compareTo
method
- comparing the service property map key using the same ordering as
- ServiceReference.compareTo
based upon service ranking
- and service id.
+ comparing the service property map key using an ordering which is
+ the same as the natural ordering of ServiceReference
s
+ as specified in ServiceReference.compareTo
.
service.ranking
property. If there are multiple target
- services with the same service ranking, then the bound service must be
- the target service with the highest service ranking and the lowest
- service id as specified by the service.id
property.
+ service whose ServiceReference
is first in the ranking
+ order as specified in ServiceReference.compareTo
.
ServiceReference.compareTo
- based upon service ranking and service id. The collection may be empty
+ using an ordering which is the same as the natural ordering of
+ ServiceReference
s as specified in
+ ServiceReference.compareTo
. The collection may be empty
if the reference has optional cardinality and there are no bound
services. If the reference is dynamic, when there is a change in the
set of bound services or the service properties of a bound service are
modified and the collection holds service properties, SCR must replace
the field value with a new mutable collection that must contain the
- updated set of bound services sorted using the same ordering as
- ServiceReference.compareTo
based upon service ranking and
- service id. The new collection may be empty if the reference has
- optional cardinality and there are no bound services.ServiceReference
s as
+ specified in ServiceReference.compareTo
. The new
+ collection may be empty if the reference has optional cardinality and
+ there are no bound services.
ServiceReference.compareTo
, to see if they can
+ create an appropriate Context, the first one that can create a Context
+ is then used.
java.naming.factory.initial
property are described. Several
steps in these algorithm iterate over a set of available services. This
- iteration must always take place in service service.ranking
service property, which is the highest
- service.ranking
value, or when equal, the lowest
- service.id
value.ServiceReference.compareTo
.service.ranking
property defines the iteration ordering of
- multiple Initial Context Factory Builder services. Implementations must
- be careful to correctly provide defaults.ServiceReference.compareTo
. Implementations must be careful
+ to correctly provide defaults.
osgi:
scheme and
- service
path returns the service with highest
- service.ranking
and the lowest service.id
. This
- scheme only allows a single service to be found. Multiple services can be
- obtained with the osgi:
scheme and servicelist
- path:service
path returns the service whose
+ ServiceReference
is first in ranking order as specified in
+ ServiceReference.compareTo
. This scheme only allows a single
+ service to be found. Multiple services can be obtained with the
+ osgi:
scheme and servicelist
path:
default
. To override the default, register a custom
ServletContextHelper
service with the name
default
. If multiple Servlet Context Helper services
- are registered with the same name, the one with the highest
- Service Ranking is used. In case of a tie, the service with the
- lowest service ID wins. In other words, the normal OSGi service
- ranking applies. ServiceReference.compareTo
, for a
+ match./foo
context looking for a pattern to match
/bar/someServlet
http://localhost/foo/bars/someOtherServlet
.
@@ -335,7 +334,7 @@ osgi.http.whiteboard.context.path = /foo/bar Then a request
linkend="service.http.whiteboard.common.properties"/>.
default
@@ -700,8 +699,8 @@ public class CDNServletContextHelper extends ServletContextHelper {
osgi.http.whiteboard.servlet.name
property, if
associated with this Servlet Context Helper. If multiple
servlets have the same name and are associated with this Servlet
- Context Helper then the highest ranked servlet is used. In the
- case of a tie, the one with the lowest service ID is
+ Context Helper, then the servlet that is first in ranking order,
+ as specified in ServiceReference.compareTo
, is
used.Servlet
and resource service registrations associated
with a single Servlet Context share the same namespace. In case of
- identical registration patterns, service ranking rules are used to select
- the service handling a request. That is, Whiteboard servlets that have
- patterns shadowed by other Whiteboard services associated with the
- ServiceReference.compareTo
, is
+ selected as the service handling a request. That is, Whiteboard servlets
+ that have patterns shadowed by other Whiteboard services associated with
+ the 500
error
code, or if an IOException
(or subclass) occurs. If there
is more than one error page registered for the same exception or error
- code, service ranking rules are used to select the handling
+ code, the service that is first in ranking order, as specified in
+ ServiceReference.compareTo
, is selected as the handling
servlet.Filter
matches, the order
- in which they are processed is governed by their service ranking. The
- servlet filter with the highest ranking is processed first in the filter
- chain, while the servlet filter with the lowest ranking is processed last,
- before the Servlet.service
method is called. In the case of a
- service ranking tie, the servlet filter with the lowest
- service.id
is processed first. After the servlet completes
+ request/response. If more than one Filter
matches, they are
+ processed in ranking order, as specified in
+ ServiceReference.compareTo
. The servlet filter with the
+ highest ranking is processed first in the filter chain, while the servlet
+ filter with the lowest ranking is processed last, before the
+ Servlet.service
method is called. After the servlet completes
its service
method the filter chain is unwound in reverse
order.ServiceReference.compareTo
.