public class DefaultAsyncReference<T> extends net.kuujo.copycat.resource.internal.AbstractResource<AsyncReference<T>> implements AsyncReference<T>
| Constructor and Description |
|---|
DefaultAsyncReference(net.kuujo.copycat.resource.internal.ResourceManager 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<AsyncReference<T>> |
open() |
CompletableFuture<Void> |
set(T value)
Sets the value.
|
addShutdownTask, addStartupTask, cluster, isClosed, isOpen, name, runShutdownTasks, runStartupTasks, stateclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreate, create, createpublic DefaultAsyncReference(net.kuujo.copycat.resource.internal.ResourceManager context)
public CompletableFuture<T> get()
AsyncReferenceProxyget in interface AsyncReferenceProxy<T>public CompletableFuture<Void> set(T value)
AsyncReferenceProxyset in interface AsyncReferenceProxy<T>value - The value to set.public CompletableFuture<T> getAndSet(T value)
AsyncReferenceProxygetAndSet in interface AsyncReferenceProxy<T>value - The new value to set.public CompletableFuture<Boolean> compareAndSet(T expect, T update)
AsyncReferenceProxycompareAndSet in interface AsyncReferenceProxy<T>expect - The expected value.update - The updated value.public CompletableFuture<AsyncReference<T>> open()
open in interface net.kuujo.copycat.util.Managed<AsyncReference<T>>public CompletableFuture<Void> close()
close in interface net.kuujo.copycat.util.Managed<AsyncReference<T>>Copyright © 2013-2015. All Rights Reserved.