public abstract class LocalBundleContext
extends java.lang.Object
The getInvokerBundleContext() method offers access to the
BundleContext of the entity accessing an OSGi service. The invoked
entity can thus discover information about the caller context.
The functionality in this class might be used by a target object that needed access to resources on the invocation. However, this approach should not be used when there is a reasonable alternative, as it makes application code dependent on usage under AOP and the Spring Dynamic Modules and AOP framework in particular.
| Modifier and Type | Field and Description |
|---|---|
private static java.lang.ThreadLocal<org.osgi.framework.BundleContext> |
invokerBundleContext
ThreadLocal holder for the invoker context.
|
| Constructor and Description |
|---|
LocalBundleContext() |
| Modifier and Type | Method and Description |
|---|---|
static org.osgi.framework.BundleContext |
getInvokerBundleContext()
Try to get the current invoker bundle context.
|
(package private) static org.osgi.framework.BundleContext |
setInvokerBundleContext(org.osgi.framework.BundleContext bundleContext)
Set the invoker bundle context.
|
private static final java.lang.ThreadLocal<org.osgi.framework.BundleContext> invokerBundleContext
public static org.osgi.framework.BundleContext getInvokerBundleContext()
null if the caller is not a Spring-DM importer.static org.osgi.framework.BundleContext setInvokerBundleContext(org.osgi.framework.BundleContext bundleContext)
bundleContext - invoker bundle contextnull is
none is set