abstract class TrackingUtil
extends java.lang.Object
OsgiServiceProxyFactoryBean . It is intended for the
bootstrap areas of the project where no classloading or listeners are required.| Modifier and Type | Class and Description |
|---|---|
private static class |
TrackingUtil.OsgiServiceHandler
JDK Proxy invocation handler that delegates all calls to services found in the OSGi space at the time of the
call, falling back to a given object.
|
| Constructor and Description |
|---|
TrackingUtil() |
| Modifier and Type | Method and Description |
|---|---|
(package private) static java.lang.Object |
getService(java.lang.Class<?>[] classes,
java.lang.String filter,
java.lang.ClassLoader classLoader,
org.osgi.framework.BundleContext context,
java.lang.Object fallbackObject)
Returns a proxy that on each call seeks the relevant OSGi service and delegates the method invocation to it.
|
static java.lang.Object getService(java.lang.Class<?>[] classes,
java.lang.String filter,
java.lang.ClassLoader classLoader,
org.osgi.framework.BundleContext context,
java.lang.Object fallbackObject)
classes - array of classes used during proxy weavingfilter - OSGi filter (can be null)classLoader - class loader to use - normally classes.getClassLoader()context - bundle context used for searching the servicesfallbackObject - object to fall back onto if no OSGi service is found.