public class OsgiServiceLookup extends Object
WicketRuntimeException
when no matching service becomes available during this period.
NOTE: Prefixing some method calls with our own class name is a workaround for a bug in the Oracle Java compiler, which does not occur when compiling in Eclipse.
Modifier and Type | Field and Description |
---|---|
static long |
DEFAULT_TIMEOUT |
Constructor and Description |
---|
OsgiServiceLookup() |
Modifier and Type | Method and Description |
---|---|
static <T> T |
getOsgiService(org.osgi.framework.BundleContext bc,
Class<T> type) |
static <T> T |
getOsgiService(org.osgi.framework.BundleContext bc,
Class<T> type,
long timeout) |
static <T> T |
getOsgiService(org.osgi.framework.BundleContext bc,
Class<T> type,
long timeout,
Map<String,String> props)
Returns a service matching the given criteria.
|
static <T> T |
getOsgiService(org.osgi.framework.BundleContext bc,
Class<T> type,
Map<String,String> props) |
static <T> T |
getOsgiService(org.osgi.framework.BundleContext bc,
String className) |
static <T> T |
getOsgiService(org.osgi.framework.BundleContext bc,
String className,
long timeout,
Map<String,String> props) |
public static final long DEFAULT_TIMEOUT
public static <T> T getOsgiService(org.osgi.framework.BundleContext bc, String className)
public static <T> T getOsgiService(org.osgi.framework.BundleContext bc, Class<T> type)
public static <T> T getOsgiService(org.osgi.framework.BundleContext bc, Class<T> type, Map<String,String> props)
public static <T> T getOsgiService(org.osgi.framework.BundleContext bc, Class<T> type, long timeout, Map<String,String> props)
T
- class implemented or extended by the servicebc
- bundle context for accessing the OSGi registrytype
- class implemented or extended by the servicetimeout
- maximum wait period in millisecondsprops
- properties to be matched by the serviceorg.apache.wicket.WicketRuntimeException
public static <T> T getOsgiService(org.osgi.framework.BundleContext bc, Class<T> type, long timeout)
Copyright © 2015. All rights reserved.