Top Description Fields Constructors Methods
net.sf.ehcache.cluster

public Class NoopCacheCluster

extends Object
implements CacheCluster
Class Inheritance
All Implemented Interfaces
net.sf.ehcache.cluster.CacheCluster
Imports
java.util.Collection, .Collections, .List

This is a dummy implementation of the CacheCluster (Null Object Pattern). It ignores all listeners and reports no nodes.
Author
Geert Bevin
Since
2.0

Field Summary

Modifier and TypeField and Description
public static final CacheCluster
INSTANCE

A singleton instance you can use rather than constructing your own.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean
addTopologyListener(ClusterTopologyListener
Listener
listener
)

Implements net.sf.ehcache.cluster.CacheCluster.addTopologyListener.

Add a listener for cluster events
public ClusterNode
getCurrentNode()

Implements net.sf.ehcache.cluster.CacheCluster.getCurrentNode.

Retrieves the ClusterNode instance that corresponds to the current node.
public Collection<ClusterNode>
getNodes()

Implements net.sf.ehcache.cluster.CacheCluster.getNodes.

Get all the nodes in the cluster
public ClusterScheme
getScheme()

Implements net.sf.ehcache.cluster.CacheCluster.getScheme.

Always returns the ClusterScheme.NONE
public List<ClusterTopologyListener>
public boolean
isClusterOnline()

Implements net.sf.ehcache.cluster.CacheCluster.isClusterOnline.

Find out if the current node is connected to the cluster or not
public void
removeAllListeners()

Implements net.sf.ehcache.cluster.CacheCluster.removeAllListeners.

Removes all listeners for cluster events
public boolean
removeTopologyListener(ClusterTopologyListener
Listener
listener
)

Implements net.sf.ehcache.cluster.CacheCluster.removeTopologyListener.

Remove a listener for cluster events
public ClusterNode
waitUntilNodeJoinsCluster()

Implements net.sf.ehcache.cluster.CacheCluster.waitUntilNodeJoinsCluster.

Waits until the current node has successfully joined the cluster.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

INSTANCEback to summary
public static final CacheCluster INSTANCE

A singleton instance you can use rather than constructing your own.

Constructor Detail

NoopCacheClusterback to summary
public NoopCacheCluster()

Method Detail

addTopologyListenerback to summary
public boolean addTopologyListener(ClusterTopologyListener listener)

Implements net.sf.ehcache.cluster.CacheCluster.addTopologyListener.

Doc from net.sf.ehcache.cluster.CacheCluster.addTopologyListener.

Add a listener for cluster events

Parameters
listener:ClusterTopologyListener

Listener

Returns:boolean

True if already listening

getCurrentNodeback to summary
public ClusterNode getCurrentNode()

Implements net.sf.ehcache.cluster.CacheCluster.getCurrentNode.

Doc from net.sf.ehcache.cluster.CacheCluster.getCurrentNode.

Retrieves the ClusterNode instance that corresponds to the current node.

Returns:ClusterNode

the ClusterNode instance that corresponds to the current node

getNodesback to summary
public Collection<ClusterNode> getNodes()

Implements net.sf.ehcache.cluster.CacheCluster.getNodes.

Doc from net.sf.ehcache.cluster.CacheCluster.getNodes.

Get all the nodes in the cluster

Returns:Collection<ClusterNode>

information on all the nodes in the cluster, including ID, hostname, and IP address.

getSchemeback to summary
public ClusterScheme getScheme()

Implements net.sf.ehcache.cluster.CacheCluster.getScheme.

Always returns the ClusterScheme.NONE

Returns:ClusterScheme

ClusterScheme#NONE

getTopologyListenersback to summary
public List<ClusterTopologyListener> getTopologyListeners()

Implements net.sf.ehcache.cluster.CacheCluster.getTopologyListeners.

Doc from net.sf.ehcache.cluster.CacheCluster.getTopologyListeners.

Get all the topology listeners

Returns:List<ClusterTopologyListener>

a list of all the topology listeners

isClusterOnlineback to summary
public boolean isClusterOnline()

Implements net.sf.ehcache.cluster.CacheCluster.isClusterOnline.

Doc from net.sf.ehcache.cluster.CacheCluster.isClusterOnline.

Find out if the current node is connected to the cluster or not

Returns:boolean

true if cluster is online otherwise false

removeAllListenersback to summary
public void removeAllListeners()

Implements net.sf.ehcache.cluster.CacheCluster.removeAllListeners.

Doc from net.sf.ehcache.cluster.CacheCluster.removeAllListeners.

Removes all listeners for cluster events

Annotations
@Override
removeTopologyListenerback to summary
public boolean removeTopologyListener(ClusterTopologyListener listener)

Implements net.sf.ehcache.cluster.CacheCluster.removeTopologyListener.

Doc from net.sf.ehcache.cluster.CacheCluster.removeTopologyListener.

Remove a listener for cluster events

Parameters
listener:ClusterTopologyListener

Listener

Returns:boolean

True if not listening

waitUntilNodeJoinsClusterback to summary
public ClusterNode waitUntilNodeJoinsCluster()

Implements net.sf.ehcache.cluster.CacheCluster.waitUntilNodeJoinsCluster.

Doc from net.sf.ehcache.cluster.CacheCluster.waitUntilNodeJoinsCluster.

Waits until the current node has successfully joined the cluster.

Returns:ClusterNode

the ClusterNode instance that corresponds to the current node