sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From k...@apache.org
Subject svn commit: r1722921 - in /sling/trunk/bundles/commons/osgi/src/main/java/org/apache/sling/commons/osgi: RankedServices.java ServiceUtil.java
Date Mon, 04 Jan 2016 17:17:32 GMT
Author: kwin
Date: Mon Jan  4 17:17:32 2016
New Revision: 1722921

URL: http://svn.apache.org/viewvc?rev=1722921&view=rev
Log:
some javadoc fixes

Modified:
    sling/trunk/bundles/commons/osgi/src/main/java/org/apache/sling/commons/osgi/RankedServices.java
    sling/trunk/bundles/commons/osgi/src/main/java/org/apache/sling/commons/osgi/ServiceUtil.java

Modified: sling/trunk/bundles/commons/osgi/src/main/java/org/apache/sling/commons/osgi/RankedServices.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/commons/osgi/src/main/java/org/apache/sling/commons/osgi/RankedServices.java?rev=1722921&r1=1722920&r2=1722921&view=diff
==============================================================================
--- sling/trunk/bundles/commons/osgi/src/main/java/org/apache/sling/commons/osgi/RankedServices.java
(original)
+++ sling/trunk/bundles/commons/osgi/src/main/java/org/apache/sling/commons/osgi/RankedServices.java
Mon Jan  4 17:17:32 2016
@@ -28,6 +28,7 @@ import java.util.SortedMap;
 import java.util.TreeMap;
 
 import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
 
 import aQute.bnd.annotation.ConsumerType;
 import aQute.bnd.annotation.ProviderType;
@@ -35,7 +36,11 @@ import aQute.bnd.annotation.ProviderType
 /**
  * Helper class that collects all services registered via OSGi bind/unbind methods.
  * The services are ordered by service ranking and can be iterated directly using this object
instance.
- * Implementation is thread-safe.
+ * Implementation is thread-safe.<br><br>
+ * <i>With Declarative Services 1.3 supporting field injection with multiple cardinality
(leveraging Collections),
+ * this class should only be used if DS 1.3 cannot be used for some reason.
+ * DS 1.3 is using the same ordering as {@link ServiceReference#compareTo(Object)}</i>
+ * <br><br>
  * <p>Usage example:</p>
  * <p>1. Define a dynamic reference with cardinality OPTIONAL_MULTIPLE in your service:
  * <pre>
@@ -62,6 +67,7 @@ import aQute.bnd.annotation.ProviderType
  * of referenced services has changed.</p>
  * @param <T> Service type
  * @since 2.3
+ * @see "OSGi Compendium 6.0, Declarative Services 1.3, Reference Field Option, $112.3.8.1"
  */
 @ProviderType
 public final class RankedServices<T> implements Iterable<T> {
@@ -73,7 +79,7 @@ public final class RankedServices<T> imp
 
   /**
    * Instantiate without change listener in ascending order (lowest service ranking first).
-   * @deprecated Use {@link #RankedService(Order)}) to explicitly give the order.
+   * @deprecated Use {@link #RankedService(Order)} to explicitly give the order.
    */
   @Deprecated
   public RankedServices() {
@@ -81,9 +87,9 @@ public final class RankedServices<T> imp
   }
   
   /**
-   * Instantiate with change listener in ascending order ((lowest service ranking first).
+   * Instantiate with change listener in ascending order (lowest service ranking first).
    * @param changeListener Change listener
-   * @deprecated use {@link #RankedServices(Order order, ChangeListener changeListener)}
 instead 
+   * @deprecated Use {@link #RankedServices(Order order, ChangeListener changeListener)}
instead 
    */
   @Deprecated
   public RankedServices(ChangeListener changeListener) {

Modified: sling/trunk/bundles/commons/osgi/src/main/java/org/apache/sling/commons/osgi/ServiceUtil.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/commons/osgi/src/main/java/org/apache/sling/commons/osgi/ServiceUtil.java?rev=1722921&r1=1722920&r2=1722921&view=diff
==============================================================================
--- sling/trunk/bundles/commons/osgi/src/main/java/org/apache/sling/commons/osgi/ServiceUtil.java
(original)
+++ sling/trunk/bundles/commons/osgi/src/main/java/org/apache/sling/commons/osgi/ServiceUtil.java
Mon Jan  4 17:17:32 2016
@@ -49,7 +49,7 @@ public class ServiceUtil {
      * The comparator will return the services in the given order. In ascending order the

      * service with the lowest ranking comes first, in descending order the service with
the 
      * highest ranking comes first. The latter is useful if you want to have the service

-     * returned first which is also chosen by {@link BundleContext#getServiceReference(String)}).
+     * returned first which is also chosen by {@link BundleContext#getServiceReference(String)}.
      * @param props The service properties.
      * @param order The order (either ascending or descending).
      * @return A comparable for the ranking of the service



Mime
View raw message