org.apache.aries.jndi.services
Class ServiceHelper
java.lang.Object
org.apache.aries.jndi.services.ServiceHelper
public final class ServiceHelper
- extends Object
This helper provides access to services registered in the OSGi service registry.
If a matching service cannot be located null may be returned. A caller should not
expect to get the same object if multiple requests are made to this API. A caller
should not expect to get a different object if multiple requests are made to this API.
A caller should avoid caching the returned service. OSGi is a dynamic environment and
the service may become unavailable while a reference to it is held. To minimize this
risk the caller should hold onto the service for the minimum length of time.
This API should not be used from within an OSGi bundle. When in an OSGi environment
the BundleContext for the bundle should be used to obtain the service.
|
Method Summary |
static Object |
getService(org.osgi.framework.BundleContext ctx,
OsgiName lookupName,
String id,
boolean dynamicRebind,
Map<String,Object> env,
boolean requireProxy)
|
static Object |
getService(org.osgi.framework.BundleContext ctx,
org.osgi.framework.ServiceReference ref)
|
static org.osgi.framework.ServiceReference[] |
getServiceReferences(org.osgi.framework.BundleContext ctx,
String interface1,
String filter,
String serviceName,
Map<String,Object> env)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ServiceHelper
public ServiceHelper()
getService
public static Object getService(org.osgi.framework.BundleContext ctx,
OsgiName lookupName,
String id,
boolean dynamicRebind,
Map<String,Object> env,
boolean requireProxy)
throws NamingException
- Throws:
NamingException
getServiceReferences
public static org.osgi.framework.ServiceReference[] getServiceReferences(org.osgi.framework.BundleContext ctx,
String interface1,
String filter,
String serviceName,
Map<String,Object> env)
throws NamingException
- Throws:
NamingException
getService
public static Object getService(org.osgi.framework.BundleContext ctx,
org.osgi.framework.ServiceReference ref)
Copyright © 2009-2011 The Apache Software Foundation. All Rights Reserved.