Interface AccessMode
public interface AccessMode
Defines the access mode of a context local storage.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final AccessModeThis access mode provides concurrent access to context local storage with thread safety and atomicity. -
Method Summary
Modifier and TypeMethodDescriptionReturn the object at indexidxin thelocalsarray.getOrCreate(Object[] locals, int idx, Supplier<Object> initialValueSupplier) Get or create the object at indexindexin thelocalsarray.voidPutvaluein thelocalsarray at indexidx
-
Field Details
-
CONCURRENT
This access mode provides concurrent access to context local storage with thread safety and atomicity.
-
-
Method Details
-
get
-
put
-
getOrCreate
Get or create the object at indexindexin thelocalsarray. When the object does not exist,initialValueSuppliermust be called to obtain this value.- Parameters:
locals- the arrayidx- the indexinitialValueSupplier- the supplier of the initial value
-