Interface DistributedPrimitive

    • Field Detail

      • DEFAULT_OPERATION_TIMEOUT_MILLIS

        static final long DEFAULT_OPERATION_TIMEOUT_MILLIS
        Default timeout for primitive operations.
        See Also:
        Constant Field Values
    • Method Detail

      • name

        java.lang.String name()
        Returns the name of this primitive.
        Returns:
        name
      • applicationId

        default ApplicationId applicationId()
        Returns the application owning this primitive.
        Returns:
        application id
      • destroy

        default java.util.concurrent.CompletableFuture<java.lang.Void> destroy()
        Purges state associated with this primitive.

        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.

        Returns:
        CompletableFuture that is completed when the operation completes
      • addStatusChangeListener

        default void addStatusChangeListener​(java.util.function.Consumer<DistributedPrimitive.Status> listener)
        Registers a listener to be called when the primitive's status changes.
        Parameters:
        listener - The listener to be called when the status changes.
      • removeStatusChangeListener

        default void removeStatusChangeListener​(java.util.function.Consumer<DistributedPrimitive.Status> listener)
        Unregisters a previously registered listener to be called when the primitive's status changes.
        Parameters:
        listener - The listener to unregister
      • statusChangeListeners

        default java.util.Collection<java.util.function.Consumer<DistributedPrimitive.Status>> statusChangeListeners()
        Returns the collection of status change listeners previously registered.
        Returns:
        collection of status change listeners