|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.osgi.util.OsgiServiceReferenceUtils
public abstract class OsgiServiceReferenceUtils
Utility class for retrieving OSGi service references. This class offers a
unified filter-based access for OSGi services as well as translation of
checked exceptions InvalidSyntaxException
into unchecked ones.
OsgiFilterUtils
underneath to allow multiple
classnames to be used for service reference lookup.
OsgiFilterUtils
Constructor Summary | |
---|---|
OsgiServiceReferenceUtils()
|
Method Summary | |
---|---|
static long |
getServiceId(ServiceReference reference)
|
static Dictionary |
getServiceProperties(ServiceReference reference)
Return a dictionary containing the properties available for the given service reference. |
static Map |
getServicePropertiesAsMap(ServiceReference reference)
Return a map containing the properties for the given service reference. |
static Dictionary |
getServicePropertiesSnapshot(ServiceReference reference)
Return a dict containing the properties available for the given service reference. |
static Map |
getServicePropertiesSnapshotAsMap(ServiceReference reference)
|
static int |
getServiceRanking(ServiceReference reference)
|
static ServiceReference |
getServiceReference(BundleContext bundleContext,
String filter)
|
static ServiceReference |
getServiceReference(BundleContext bundleContext,
String[] classes)
|
static ServiceReference |
getServiceReference(BundleContext bundleContext,
String[] classes,
String filter)
|
static ServiceReference |
getServiceReference(BundleContext bundleContext,
String clazz,
String filter)
|
static ServiceReference[] |
getServiceReferences(BundleContext bundleContext,
String filter)
Return the service reference that match the given filter. |
static ServiceReference[] |
getServiceReferences(BundleContext bundleContext,
String[] classes)
|
static ServiceReference[] |
getServiceReferences(BundleContext bundleContext,
String[] classes,
String filter)
|
static ServiceReference[] |
getServiceReferences(BundleContext bundleContext,
String clazz,
String filter)
|
static boolean |
isServicePresent(BundleContext context,
String serviceFilter)
Check if the given serviceFilter returns at least one match or not. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public OsgiServiceReferenceUtils()
Method Detail |
---|
public static ServiceReference getServiceReference(BundleContext bundleContext, String[] classes)
public static ServiceReference getServiceReference(BundleContext bundleContext, String clazz, String filter)
public static ServiceReference getServiceReference(BundleContext bundleContext, String[] classes, String filter)
public static ServiceReference getServiceReference(BundleContext bundleContext, String filter)
public static ServiceReference[] getServiceReferences(BundleContext bundleContext, String[] classes)
public static ServiceReference[] getServiceReferences(BundleContext bundleContext, String clazz, String filter)
public static ServiceReference[] getServiceReferences(BundleContext bundleContext, String[] classes, String filter)
public static ServiceReference[] getServiceReferences(BundleContext bundleContext, String filter)
bundleContext
- filter
-
public static long getServiceId(ServiceReference reference)
public static int getServiceRanking(ServiceReference reference)
public static Dictionary getServicePropertiesSnapshot(ServiceReference reference)
reference
- service reference
public static Map getServicePropertiesSnapshotAsMap(ServiceReference reference)
public static Dictionary getServiceProperties(ServiceReference reference)
reference
- an OSGi service reference
public static Map getServicePropertiesAsMap(ServiceReference reference)
getServiceProperties(ServiceReference)
which
returns an object that extends Dictionary
as well as implements
the Map
interface.
reference
-
getServiceProperties(ServiceReference)
public static boolean isServicePresent(BundleContext context, String serviceFilter)
context
- serviceFilter
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |