ehcache

net.sf.ehcache.cluster
Class NoopCacheCluster

java.lang.Object
  extended by net.sf.ehcache.cluster.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 Summary
static CacheCluster INSTANCE
          A singleton instance you can use rather than constructing your own.
 
Constructor Summary
NoopCacheCluster()
           
 
Method Summary
 boolean addTopologyListener(ClusterTopologyListener listener)
          Add a listener for cluster events
 java.util.Collection<ClusterNode> getNodes()
          Get all the nodes in the cluster
 ClusterScheme getScheme()
          Always returns the ClusterScheme.NONE
 boolean removeTopologyListener(ClusterTopologyListener listener)
          Remove a listener for cluster events
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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:
All the ClusterNodes

getScheme

public ClusterScheme getScheme()
Always returns the ClusterScheme.NONE

Specified by:
getScheme in interface CacheCluster
Returns:
ClusterScheme.NONE

addTopologyListener

public boolean addTopologyListener(ClusterTopologyListener listener)
Add a listener for cluster events

Specified by:
addTopologyListener in interface CacheCluster
Parameters:
listener - Listener
Returns:
True if already listening

removeTopologyListener

public boolean removeTopologyListener(ClusterTopologyListener listener)
Remove a listener for cluster events

Specified by:
removeTopologyListener in interface CacheCluster
Parameters:
listener - Listener
Returns:
True if not listening

ehcache

true