private static class TransactionManager.ContextContainer extends ContextLocal<TransactionManager.WorkArea>
HEADLESS_KEY
Modifier | Constructor and Description |
---|---|
private |
ContextContainer() |
Modifier and Type | Method and Description |
---|---|
WeightFactor |
getWeight()
Get the weight of this context-local var.
|
protected TransactionManager.WorkArea |
initialValue()
Return
null rather than providing a true initial value;
initial value is instead lazily created in obtain() . |
TransactionManager.WorkArea |
obtain()
Obtains the context-local instance of the contained global work
area.
|
cleanup, clearInstance, dumpDependencies, get, get, isResetAllowed, set, setDebug
equals, hashCode
public WeightFactor getWeight()
getWeight
in interface WeightedToken
getWeight
in class ContextLocal<TransactionManager.WorkArea>
WeightFactor.LEVEL_4
.public TransactionManager.WorkArea obtain()
WorkArea
instance is lazily created. This is done here
rather than using the more elegant mechanism of overriding the
superclass' initialValue
method, because we must ensure
we do not trigger an infinite loop. Infinite looping can occur
because a new work area requires that each ScopeableFactory
create its Scopeable
instance. These objects may call back
into the TransactionManager
to register for various
service hooks, which will in turn trigger a call to this method.
By implementing the WorkArea
instantiation here, we can
set the ContextContainer
's contents before the
factories are asked to create their Scopeable
s. Thus,
any recursion into this method during Scopeable
initialization is safe.protected final TransactionManager.WorkArea initialValue()
null
rather than providing a true initial value;
initial value is instead lazily created in obtain()
.initialValue
in class ContextLocal<TransactionManager.WorkArea>
null
.