[
https://issues.apache.org/jira/browse/SLING-55?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Bertrand Delacretaz resolved SLING-55.
--------------------------------------
Resolution: Fixed
Fixed in revisions 586028 and 586029, the ServiceLocator is currently used only
to access the ResourceResolver.
That's overkill, as in microsling we don't provide a way to use a different
service, but again the idea is to expose the ServiceLocator in the API, so that
people aren't surprised when they see it in Sling OSGi.
> microsling: add ServiceLocator?
> -------------------------------
>
> Key: SLING-55
> URL: https://issues.apache.org/jira/browse/SLING-55
> Project: Sling
> Issue Type: Improvement
> Components: microsling
> Reporter: Bertrand Delacretaz
>
> It might be good to introduce the ServiceLocator interface in microsling.
> That interface should probably be part of the Sling core API anyway.
> We don't need it right now in microsling, but as soon as there's a good
> reason to have it (like the OCM maybe) I think we should introduce it, even
> if it's with a naive implementation, as it's an important part of the power
> of Sling OSGi.
> Here's the Sling interface:
> public interface ServiceLocator {
> /** The name of the request attribute holding the service locator. */
> String REQUEST_ATTRIBUTE_NAME = "org.apache.sling.core.ServiceLocator";
> /**
> * Lookup and return the service from the service registry.
> *
> * @param serviceName The name (interface) of the service.
> * @return The service object or null if the service is not available.
> */
> Object getService(String serviceName);
> /**
> * Lookup and return the services from the service registry.
> *
> * @param serviceName The name (interface) of the service.
> * @param filter An optional filter
> * @return The services object or null.
> */
> Object[] getService(String serviceName, String filter)
> throws InvalidSyntaxException;
> }
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.