public abstract class DelegatingDistributedPrimitive extends Object implements DistributedPrimitive
DistributedPrimitive.Status, DistributedPrimitive.TypeDEFAULT_OPERTATION_TIMEOUT_MILLIS| Constructor and Description |
|---|
DelegatingDistributedPrimitive(DistributedPrimitive primitive) |
| Modifier and Type | Method and Description |
|---|---|
void |
addStatusChangeListener(Consumer<DistributedPrimitive.Status> listener)
Registers a listener to be called when the primitive's status changes.
|
ApplicationId |
applicationId()
Returns the application owning this primitive.
|
CompletableFuture<Void> |
destroy()
Purges state associated with this primitive.
|
boolean |
equals(Object other) |
int |
hashCode() |
String |
name()
Returns the name of this primitive.
|
DistributedPrimitive.Type |
primitiveType()
Returns the type of primitive.
|
void |
removeStatusChangeListener(Consumer<DistributedPrimitive.Status> listener)
Unregisters a previously registered listener to be called when the primitive's status changes.
|
Collection<Consumer<DistributedPrimitive.Status>> |
statusChangeListeners()
Returns the collection of status change listeners previously registered.
|
String |
toString() |
public DelegatingDistributedPrimitive(DistributedPrimitive primitive)
public String name()
DistributedPrimitivename in interface DistributedPrimitivepublic DistributedPrimitive.Type primitiveType()
DistributedPrimitiveprimitiveType in interface DistributedPrimitivepublic ApplicationId applicationId()
DistributedPrimitiveapplicationId in interface DistributedPrimitivepublic CompletableFuture<Void> destroy()
DistributedPrimitiveImplementations 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.
destroy in interface DistributedPrimitiveCompletableFuture that is completed when the operation completespublic void addStatusChangeListener(Consumer<DistributedPrimitive.Status> listener)
DistributedPrimitiveaddStatusChangeListener in interface DistributedPrimitivelistener - The listener to be called when the status changes.public void removeStatusChangeListener(Consumer<DistributedPrimitive.Status> listener)
DistributedPrimitiveremoveStatusChangeListener in interface DistributedPrimitivelistener - The listener to unregisterpublic Collection<Consumer<DistributedPrimitive.Status>> statusChangeListeners()
DistributedPrimitivestatusChangeListeners in interface DistributedPrimitive