Top Description Fields Methods
io.vertx.core.spi.context.storage

public Interface AccessMode

Imports
java.util.concurrent.atomic.AtomicReferenceArray, java.util.function.Supplier

Defines the access mode of a context local storage.

Field Summary

Modifier and TypeField and Description
public static final AccessMode
CONCURRENT

This access mode provides concurrent access to context local storage with thread safety and atomicity.

Method Summary

Modifier and TypeMethod and Description
public Object

Returns:

the object at index
get
(AtomicReferenceArray<Object>
the array
locals
,
int
the index
idx
)

Return the object at index idx in the locals array.

public Object
getOrCreate(AtomicReferenceArray<Object>
the array
locals
,
int
the index
idx
,
Supplier<Object>
the supplier of the initial value
initialValueSupplier
)

Get or create the object at index index in the locals array.

public void
put(AtomicReferenceArray<Object>
the array
locals
,
int
the index
idx
,
Object
the value
value
)

Put value in the locals array at index idx

Field Detail

CONCURRENTback to summary
public static final AccessMode CONCURRENT

This access mode provides concurrent access to context local storage with thread safety and atomicity.

Method Detail

getback to summary
public Object get(AtomicReferenceArray<Object> locals, int idx)

Return the object at index idx in the locals array.

Parameters
locals:AtomicReferenceArray<Object>

the array

idx:int

the index

Returns:Object

the object at index

getOrCreateback to summary
public Object getOrCreate(AtomicReferenceArray<Object> locals, int idx, Supplier<Object> initialValueSupplier)

Get or create the object at index index in the locals array. When the object does not exist, initialValueSupplier must be called to obtain this value.

Parameters
locals:AtomicReferenceArray<Object>

the array

idx:int

the index

initialValueSupplier:Supplier<Object>

the supplier of the initial value

putback to summary
public void put(AtomicReferenceArray<Object> locals, int idx, Object value)

Put value in the locals array at index idx

Parameters
locals:AtomicReferenceArray<Object>

the array

idx:int

the index

value:Object

the value