|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.robokind.api.common.osgi.OSGiUtils
public class OSGiUtils
Utility methods for working with OSGi.
Constructor Summary | |
---|---|
OSGiUtils()
|
Method Summary | ||
---|---|---|
static
|
buildSingleServiceListener(Class<T> clazz,
org.osgi.framework.BundleContext context,
String idPropertyName,
String idString,
String filter)
|
|
static String |
createIdFilter(String idPropertyName,
String idString,
String filter)
|
|
static String |
createServiceFilter(Properties props)
Creates a filter string which matches all of the properties given. |
|
static String |
createServiceFilter(String key,
String val)
Creates a filter string which matches the key and value given |
|
static String |
formatPropertiesString(org.osgi.framework.ServiceReference ref)
|
|
static String |
formatUsingBundlesString(org.osgi.framework.ServiceReference ref)
|
|
static org.osgi.framework.BundleContext |
getBundleContext(Class clazz)
Returns the BundleContext associated with the given Class. |
|
static String |
getInformationString(org.osgi.framework.ServiceReference ref)
|
|
static
|
getService(Class<T> clazz,
org.osgi.framework.BundleContext context,
org.osgi.framework.ServiceReference ref)
|
|
static org.osgi.framework.ServiceRegistration |
registerService(org.osgi.framework.BundleContext context,
String className,
String idPropertyName,
String idString,
Object service,
Properties serviceProperties)
|
|
static org.osgi.framework.ServiceRegistration |
registerUniqueService(org.osgi.framework.BundleContext context,
String className,
String idPropertyName,
String idString,
Object service,
Properties serviceProperties)
|
|
static Boolean |
serviceExists(org.osgi.framework.BundleContext context,
Class[] classes,
String filter)
Checks the OSGi Service Registry for an existing Service matching the given filter String and one or more of the given Class names. |
|
static Boolean |
serviceExists(org.osgi.framework.BundleContext context,
Class clazz,
String filter)
Checks the OSGi Service Registry for a Service with the given class and matching the given filter. |
|
static Boolean |
serviceExists(org.osgi.framework.BundleContext context,
String clazz,
Properties props)
|
|
static Boolean |
serviceExists(org.osgi.framework.BundleContext context,
String clazz,
String filter)
Checks the OSGi Service Registry for a Service with the given class and matching the given filter. |
|
static Boolean |
serviceExists(org.osgi.framework.BundleContext context,
String clazz,
String idPropertyName,
String idString,
Properties props)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public OSGiUtils()
Method Detail |
---|
public static org.osgi.framework.BundleContext getBundleContext(Class clazz)
clazz
- Class associated with a Bundle
public static String createServiceFilter(Properties props)
props
- Properties to match
public static String createServiceFilter(String key, String val)
key
- keyval
- value
public static String createIdFilter(String idPropertyName, String idString, String filter)
public static Boolean serviceExists(org.osgi.framework.BundleContext context, String clazz, String filter)
context
- BundleContext to useclazz
- Class name to matchfilter
- OSGi Service filter String
public static Boolean serviceExists(org.osgi.framework.BundleContext context, String clazz, Properties props)
public static Boolean serviceExists(org.osgi.framework.BundleContext context, String clazz, String idPropertyName, String idString, Properties props)
public static Boolean serviceExists(org.osgi.framework.BundleContext context, Class clazz, String filter)
context
- BundleContext to useclazz
- Class to matchfilter
- OSGi Service filter String
public static Boolean serviceExists(org.osgi.framework.BundleContext context, Class[] classes, String filter)
context
- BundleContext to useclasses
- one or more of the classes must be matchedfilter
- OSGi Service filter String to match
public static <T> T getService(Class<T> clazz, org.osgi.framework.BundleContext context, org.osgi.framework.ServiceReference ref)
public static String getInformationString(org.osgi.framework.ServiceReference ref)
public static String formatPropertiesString(org.osgi.framework.ServiceReference ref)
public static String formatUsingBundlesString(org.osgi.framework.ServiceReference ref)
public static <T> SingleServiceListener<T> buildSingleServiceListener(Class<T> clazz, org.osgi.framework.BundleContext context, String idPropertyName, String idString, String filter)
public static org.osgi.framework.ServiceRegistration registerService(org.osgi.framework.BundleContext context, String className, String idPropertyName, String idString, Object service, Properties serviceProperties)
public static org.osgi.framework.ServiceRegistration registerUniqueService(org.osgi.framework.BundleContext context, String className, String idPropertyName, String idString, Object service, Properties serviceProperties)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |