public interface AccessMode
Modifier and Type | Field and Description |
---|---|
static AccessMode |
CONCURRENT
This access mode provides concurrent access to context local storage with thread safety and atomicity.
|
Modifier and Type | Method and Description |
---|---|
Object |
get(AtomicReferenceArray<Object> locals,
int idx)
Return the object at index
idx in the locals array. |
Object |
getOrCreate(AtomicReferenceArray<Object> locals,
int idx,
java.util.function.Supplier<Object> initialValueSupplier)
Get or create the object at index
index in the locals array. |
void |
put(AtomicReferenceArray<Object> locals,
int idx,
Object value)
Put
value in the locals array at index idx |
static final AccessMode CONCURRENT
Object get(AtomicReferenceArray<Object> locals, int idx)
idx
in the locals
array.locals
- the arrayidx
- the indexindex
void put(AtomicReferenceArray<Object> locals, int idx, Object value)
value
in the locals
array at index idx
locals
- the arrayidx
- the indexvalue
- the valueObject getOrCreate(AtomicReferenceArray<Object> locals, int idx, java.util.function.Supplier<Object> initialValueSupplier)
index
in the locals
array. When the object
does not exist, initialValueSupplier
must be called to obtain this value.locals
- the arrayidx
- the indexinitialValueSupplier
- the supplier of the initial valueCopyright © 2024 Eclipse. All rights reserved.