Interface Singleton

All Known Subinterfaces:
SingletonService, SingletonService<T>, SingletonServiceController<T>

public interface Singleton
Encapsulates an object that can be provided by multiple cluster members, but is only active on one member a time.
Author:
Paul Ferraro
  • Method Details

    • isPrimary

      @Deprecated(forRemoval=true) default boolean isPrimary()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use getSingletonState() instead.
      Indicates whether this node is the primary provider of the singleton.
      Returns:
      true, if this node is the primary node, false if it is a backup node.
    • getPrimaryProvider

      @Deprecated(forRemoval=true) default Node getPrimaryProvider()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use getSingletonState() instead.
      Returns the current primary provider of the singleton.
      Returns:
      a cluster member
    • getProviders

      @Deprecated(forRemoval=true) default Set<Node> getProviders()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Use getSingletonState() instead.
      Returns the providers on which the given singleton is available.
      Returns:
      a set of cluster members
    • getSingletonState

      SingletonState getSingletonState()
      Returns a snapshot of the state of this singleton.
      Returns:
      a snapshot of the state of this singleton.