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.