Author: kwin
Date: Mon Apr 18 16:52:17 2016
New Revision: 1739790

URL: http://svn.apache.org/viewvc?rev=1739790&view=rev
Log:
SLING-5664 document the consideration of the service ranking for the OSGi 
injector

Modified:
    sling/site/trunk/content/documentation/bundles/models.mdtext

Modified: sling/site/trunk/content/documentation/bundles/models.mdtext
URL: 
http://svn.apache.org/viewvc/sling/site/trunk/content/documentation/bundles/models.mdtext?rev=1739790&r1=1739789&r2=1739790&view=diff
==============================================================================
--- sling/site/trunk/content/documentation/bundles/models.mdtext (original)
+++ sling/site/trunk/content/documentation/bundles/models.mdtext Mon Apr 18 
16:52:17 2016
@@ -364,7 +364,7 @@ Script Bindings    | `script-bindings`
 Value Map          | `valuemap`              | 2000                | 1.0.0     
                               | Gets a property from a `ValueMap` by name. | 
Any object which is or can be adapted to a `ValueMap`| no | Primitive arrays 
wrapped/unwrapped as necessary. Wrapper object arrays are unwrapped/wrapped as 
necessary. | Parameterized `List` and `Collection` injection points are 
injected by getting an array of the component type and creating an unmodifiable 
`List` from the array.
 Child Resources    | `child-resources`       | 3000                | 1.0.0     
                               | Gets a child resource by name. | `Resource` 
objects | no | none | if a parameterized type is passed, a `List<Resource>` is 
returned (the contents of which may be adapted to the target type).
 Request Attributes | `request-attributes`    | 4000                | 1.0.0     
                               | Get a request attribute by name. | 
`ServletRequest` objects | no | no conversion is done | If a parameterized type 
is passed, the request attribute must be of a compatible type of the 
parameterized type.
-OSGi Services      | `osgi-services`         | 5000                | 1.0.0     
                               | Lookup services based on class name. | Any 
object | yes | yes | Parameterized `List` and `Collection` injection points are 
injected by getting an array of the services and creating an unmodifiable 
`List` from the array.
+OSGi Services      | `osgi-services`         | 5000                | 1.0.0     
                               | Lookup services based on class name. Since 
Sling Models Impl 1.2.8 
([SLING-5664](https://issues.apache.org/jira/browse/SLING-5664)) the service 
with the highest service ranking is returned. In case multiple services are 
returned, they are ordered descending by their service ranking (i.e. the one 
with the highest ranking first). | Any object | yes | yes | Parameterized 
`List` and `Collection` injection points are injected by getting an array of 
the services and creating an unmodifiable `List` from the array.
 Resource Path      | `resource-path`         | 2500                | 1.1.0     
                               | Injects a resource by its path derived from 
the name. | `Resource` or `SlingHttpServletRequest` objects | yes | none | none
 Self               | `self`                  | `Integer.MAX_VALUE` | 1.1.0     
                               | Injects the adaptable object itself (if the 
class of the field matches or is a supertype). If the @Self annotation is 
present it is tried to adapt the adaptable to the field type.  | Any object | 
yes | none | none
 Sling Object       | `sling-object`          | `Integer.MAX_VALUE` | 1.1.0     
                               | Injects commonly used sling objects if the 
field matches with the class: request, response, resource resolver, current 
resource, SlingScriptHelper. This works only if the adaptable can get the 
according information, i.e. all objects are available via 
`SlingHttpServletRequest` while `ResourceResolver` can only resolve the 
`ResourceResolver` object and nothing else. A discussion around this limitation 
can be found at [SLING-4083](https://issues.apache.org/jira/browse/SLING-4083). 
Also `Resource`s can only be injected if the according injector-specific 
annotation is used (`@SlingObject`). | `Resource`, `ResourceResolver` or 
`SlingHttpServletRequest` objects (not all objects can be resolved by all 
adaptables).  | yes | none | none


Reply via email to