Class NoopCacheCluster

  • All Implemented Interfaces:
    CacheCluster

    public class NoopCacheCluster
    extends java.lang.Object
    implements CacheCluster
    This is a dummy implementation of the CacheCluster (Null Object Pattern). It ignores all listeners and reports no nodes.
    Since:
    2.0
    Author:
    Geert Bevin
    • Field Detail

      • INSTANCE

        public static final CacheCluster INSTANCE
        A singleton instance you can use rather than constructing your own.
    • Constructor Detail

      • NoopCacheCluster

        public NoopCacheCluster()
    • Method Detail

      • getNodes

        public java.util.Collection<ClusterNode> getNodes()
        Get all the nodes in the cluster
        Specified by:
        getNodes in interface CacheCluster
        Returns:
        information on all the nodes in the cluster, including ID, hostname, and IP address.
      • isClusterOnline

        public boolean isClusterOnline()
        Find out if the current node is connected to the cluster or not
        Specified by:
        isClusterOnline in interface CacheCluster
        Returns:
        true if cluster is online otherwise false
      • getCurrentNode

        public ClusterNode getCurrentNode()
        Retrieves the ClusterNode instance that corresponds to the current node.
        Specified by:
        getCurrentNode in interface CacheCluster
        Returns:
        the ClusterNode instance that corresponds to the current node
      • waitUntilNodeJoinsCluster

        public ClusterNode waitUntilNodeJoinsCluster()
        Waits until the current node has successfully joined the cluster.
        Specified by:
        waitUntilNodeJoinsCluster in interface CacheCluster
        Returns:
        the ClusterNode instance that corresponds to the current node