T - the entity type associated with active bundlesclass LazyBundleRegistry<T>
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
(package private) static interface |
LazyBundleRegistry.Activator<V>
Activator action performed on lazy bundles upon promotion.
|
(package private) static interface |
LazyBundleRegistry.Condition
A simple condition-like class.
|
(package private) static interface |
LazyBundleRegistry.Operation<T,V>
Operation performed all bundles - first active ones, followed by lazy ones (if nothing is found (null is
returned)) by 'activating' them.
|
| Modifier and Type | Field and Description |
|---|---|
private LazyBundleRegistry.Activator<T> |
activator |
private java.util.concurrent.ConcurrentMap<org.osgi.framework.Bundle,T> |
activeBundles
active, valid bundles
|
private LazyBundleRegistry.Condition |
condition |
private java.util.concurrent.ConcurrentMap<org.osgi.framework.Bundle,java.lang.Boolean> |
lazyBundles
lazy bundles (potentially invalid)
|
private org.apache.commons.logging.Log |
log
logger
|
private java.util.List<org.osgi.framework.Bundle> |
promotionQueue
Queue of bundles that have been activated and validated and should be removed from the lazy map.
|
private java.util.concurrent.atomic.AtomicInteger |
threadCounter
counter used for determining the promotion thread
|
| Constructor and Description |
|---|
LazyBundleRegistry(LazyBundleRegistry.Condition promotionCondition,
LazyBundleRegistry.Activator<T> activator,
org.apache.commons.logging.Log log) |
| Modifier and Type | Method and Description |
|---|---|
(package private) void |
add(org.osgi.framework.Bundle bundle,
boolean isLazy,
boolean applyCondition) |
(package private) <V> V |
apply(LazyBundleRegistry.Operation<T,V> action)
Applies an operation on all the bundles.
|
void |
clear() |
(package private) boolean |
remove(org.osgi.framework.Bundle bundle) |
private final org.apache.commons.logging.Log log
private final java.util.concurrent.ConcurrentMap<org.osgi.framework.Bundle,T> activeBundles
private final java.util.concurrent.ConcurrentMap<org.osgi.framework.Bundle,java.lang.Boolean> lazyBundles
private final java.util.List<org.osgi.framework.Bundle> promotionQueue
private volatile java.util.concurrent.atomic.AtomicInteger threadCounter
private final LazyBundleRegistry.Condition condition
private final LazyBundleRegistry.Activator<T> activator
LazyBundleRegistry(LazyBundleRegistry.Condition promotionCondition, LazyBundleRegistry.Activator<T> activator, org.apache.commons.logging.Log log)
void add(org.osgi.framework.Bundle bundle,
boolean isLazy,
boolean applyCondition)
boolean remove(org.osgi.framework.Bundle bundle)
<V> V apply(LazyBundleRegistry.Operation<T,V> action) throws java.lang.Exception
V - action - java.lang.Exceptionpublic void clear()