public class OsgiBundleScope
extends java.lang.Object
implements org.springframework.beans.factory.config.Scope, org.springframework.beans.factory.DisposableBean
Scope
implementation.
Will allow per--calling-bundle object instance, thus this scope becomes
useful when enabled on localBeans exposed as OSGi services.| Modifier and Type | Class and Description |
|---|---|
static class |
OsgiBundleScope.BundleScopeServiceFactory
Decorating
ServiceFactory used for supporting
'bundle' scoped localBeans. |
| Modifier and Type | Field and Description |
|---|---|
private java.util.Map<java.lang.String,java.lang.Runnable> |
destructionCallbacks
Unsynchronized map of callbacks for the services used by the running
bundle.
|
static java.lang.ThreadLocal<java.lang.Object> |
EXTERNAL_BUNDLE
ThreadLocal used for passing objects around
OsgiBundleScope and
OsgiBundleScope.BundleScopeServiceFactory (there is only one scope instance but
multiple BSSFs). |
private java.util.Map<java.lang.String,java.lang.Object> |
localBeans
Map of localBeans imported by the current bundle from other bundles.
|
private static org.apache.commons.logging.Log |
log |
static java.lang.String |
SCOPE_NAME |
| Constructor and Description |
|---|
OsgiBundleScope() |
| Modifier and Type | Method and Description |
|---|---|
void |
destroy() |
java.lang.Object |
get(java.lang.String name,
org.springframework.beans.factory.ObjectFactory<?> objectFactory) |
java.lang.String |
getConversationId() |
private boolean |
isExternalBundleCalling() |
void |
registerDestructionCallback(java.lang.String name,
java.lang.Runnable callback) |
java.lang.Object |
remove(java.lang.String name) |
java.lang.Object |
resolveContextualObject(java.lang.String key) |
public static final java.lang.String SCOPE_NAME
private static final org.apache.commons.logging.Log log
public static final java.lang.ThreadLocal<java.lang.Object> EXTERNAL_BUNDLE
OsgiBundleScope and
OsgiBundleScope.BundleScopeServiceFactory (there is only one scope instance but
multiple BSSFs).private final java.util.Map<java.lang.String,java.lang.Object> localBeans
OsgiBundleScope
.private final java.util.Map<java.lang.String,java.lang.Runnable> destructionCallbacks
private boolean isExternalBundleCalling()
public java.lang.Object get(java.lang.String name,
org.springframework.beans.factory.ObjectFactory<?> objectFactory)
get in interface org.springframework.beans.factory.config.Scopepublic java.lang.String getConversationId()
getConversationId in interface org.springframework.beans.factory.config.Scopepublic void registerDestructionCallback(java.lang.String name,
java.lang.Runnable callback)
registerDestructionCallback in interface org.springframework.beans.factory.config.Scopepublic java.lang.Object remove(java.lang.String name)
remove in interface org.springframework.beans.factory.config.Scopepublic java.lang.Object resolveContextualObject(java.lang.String key)
resolveContextualObject in interface org.springframework.beans.factory.config.Scopepublic void destroy()
destroy in interface org.springframework.beans.factory.DisposableBean