public interface DistributedPrimitive
Modifier and Type | Interface and Description |
---|---|
static class |
DistributedPrimitive.Status
Status of distributed primitive.
|
static class |
DistributedPrimitive.Type
Type of distributed primitive.
|
Modifier and Type | Field and Description |
---|---|
static long |
DEFAULT_OPERATION_TIMEOUT_MILLIS
Default timeout for primitive operations.
|
static long |
DEFAULT_OPERTATION_TIMEOUT_MILLIS
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
default void |
addStatusChangeListener(java.util.function.Consumer<DistributedPrimitive.Status> listener)
Registers a listener to be called when the primitive's status changes.
|
default ApplicationId |
applicationId()
Returns the application owning this primitive.
|
default java.util.concurrent.CompletableFuture<java.lang.Void> |
destroy()
Purges state associated with this primitive.
|
java.lang.String |
name()
Returns the name of this primitive.
|
DistributedPrimitive.Type |
primitiveType()
Returns the type of primitive.
|
default void |
removeStatusChangeListener(java.util.function.Consumer<DistributedPrimitive.Status> listener)
Unregisters a previously registered listener to be called when the primitive's status changes.
|
default java.util.Collection<java.util.function.Consumer<DistributedPrimitive.Status>> |
statusChangeListeners()
Returns the collection of status change listeners previously registered.
|
@Deprecated static final long DEFAULT_OPERTATION_TIMEOUT_MILLIS
DEFAULT_OPERATION_TIMEOUT_MILLIS
instead.static final long DEFAULT_OPERATION_TIMEOUT_MILLIS
java.lang.String name()
DistributedPrimitive.Type primitiveType()
default ApplicationId applicationId()
default java.util.concurrent.CompletableFuture<java.lang.Void> destroy()
Implementations can override and provide appropriate clean up logic for purging any state state associated with the primitive. Whether modifications made within the destroy method have local or global visibility is left unspecified.
CompletableFuture
that is completed when the operation completesdefault void addStatusChangeListener(java.util.function.Consumer<DistributedPrimitive.Status> listener)
listener
- The listener to be called when the status changes.default void removeStatusChangeListener(java.util.function.Consumer<DistributedPrimitive.Status> listener)
listener
- The listener to unregisterdefault java.util.Collection<java.util.function.Consumer<DistributedPrimitive.Status>> statusChangeListeners()