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

        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 CompletableFuture<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​(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​(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 Collection<Consumer<DistributedPrimitive.Status>> statusChangeListeners()
        Returns the collection of status change listeners previously registered.
        Returns:
        collection of status change listeners