public class DefaultAsyncAtomicReference<T> extends AbstractResource<AsyncAtomicReference<T>> implements AsyncAtomicReference<T>
context, executor, serializer| Constructor and Description |
|---|
DefaultAsyncAtomicReference(ResourceContext context) |
| Modifier and Type | Method and Description |
|---|---|
CompletableFuture<Void> |
close() |
CompletableFuture<Boolean> |
compareAndSet(T expect,
T update)
Sets the value if the current value == the expected value.
|
CompletableFuture<T> |
get()
Gets the value.
|
CompletableFuture<T> |
getAndSet(T value)
Sets and gets the value.
|
CompletableFuture<AsyncAtomicReference<T>> |
open() |
CompletableFuture<Void> |
set(T value)
Sets the value.
|
addShutdownTask, addStartupTask, cluster, isClosed, isOpen, name, runShutdownTasks, runStartupTasksclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreate, create, createaddShutdownTask, addStartupTask, cluster, namepublic DefaultAsyncAtomicReference(ResourceContext context)
public CompletableFuture<T> get()
AsyncAtomicReferenceProxyget in interface AsyncAtomicReferenceProxy<T>public CompletableFuture<Void> set(T value)
AsyncAtomicReferenceProxyset in interface AsyncAtomicReferenceProxy<T>value - The value to set.public CompletableFuture<T> getAndSet(T value)
AsyncAtomicReferenceProxygetAndSet in interface AsyncAtomicReferenceProxy<T>value - The new value to set.public CompletableFuture<Boolean> compareAndSet(T expect, T update)
AsyncAtomicReferenceProxycompareAndSet in interface AsyncAtomicReferenceProxy<T>expect - The expected value.update - The updated value.public CompletableFuture<AsyncAtomicReference<T>> open()
open in interface Managed<AsyncAtomicReference<T>>public CompletableFuture<Void> close()
close in interface Managed<AsyncAtomicReference<T>>Copyright © 2013-2015. All Rights Reserved.