private static class SharedVariableManager.PersistentShares<T extends SharedVariableManager.PersistentRegistry>
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private T |
globals
Global pool which is context-local.
|
private SharedVariableManager.PersistentRegistry |
pending
The objects being defined in the currently instantiating external program.
|
private java.util.Map<java.lang.Object,T> |
persistentDictionaries
The persistent dictionaries, saved per each external program.
|
private java.util.IdentityHashMap<java.lang.Object,java.util.concurrent.atomic.AtomicInteger> |
refs
Track references for all shared objects, in all registries (not defined/used) - when
the reference count reaches zero, they will be removed from the transaction-related
registries.
|
Modifier | Constructor and Description |
---|---|
private |
PersistentShares(T globals)
Initialize this container with the specified global registry, which will be used as a
seed for all other scopes.
|
Modifier and Type | Method and Description |
---|---|
T |
getPending(boolean source)
Resolve the registry or return the
pending if it was already resolved. |
T |
getPending(boolean source,
boolean clone)
Resolve the registry or return the
pending if it was already resolved. |
T |
lookupRegistry(java.lang.String name)
Lookup a
SharedVariableManager.PersistentRegistry which contains a shared variable with the given name;
this starts from the top of the stack and searches in the context of each
referent for the given variable name. |
private final java.util.Map<java.lang.Object,T extends SharedVariableManager.PersistentRegistry> persistentDictionaries
private final java.util.IdentityHashMap<java.lang.Object,java.util.concurrent.atomic.AtomicInteger> refs
private SharedVariableManager.PersistentRegistry pending
private final T extends SharedVariableManager.PersistentRegistry globals
private PersistentShares(T globals)
public T getPending(boolean source)
pending
if it was already resolved.source
- Flag indicating which procedure to use as master registry: when true
,
use SOURCE-PROCEDURE, otherwise THIS-PROCEDURE.pending
registry.public T getPending(boolean source, boolean clone)
pending
if it was already resolved.source
- Flag indicating which procedure to use as master registry: when true
,
use SOURCE-PROCEDURE, otherwise THIS-PROCEDURE.clone
- Flag indicating if the resolved registry should be cloned. The pending
registry is assigned only if clone was performed.pending
registry or the resolved one.public T lookupRegistry(java.lang.String name)
SharedVariableManager.PersistentRegistry
which contains a shared variable with the given name;
this starts from the top of the stack and searches in the context of each
referent
for the given variable name.name
- The shared object name.SharedVariableManager.PersistentRegistry
or null
if it can't be found.