Top Description Methods
net.sf.ehcache.cluster

public Interface CacheCluster

Known Direct Implementers
net.sf.ehcache.cluster.NoopCacheCluster, net.sf.ehcache.terracotta.TerracottaCacheCluster
Imports
java.util.Collection, .List

Allows you to explore the Terracotta cluster nodes and register for events about the cluster.
Author
Geert Bevin, Abhishek Sanoujam
Since
2.0

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

True if already listening
addTopologyListener
(ClusterTopologyListener
Listener
listener
)

Add a listener for cluster events

public ClusterNode

Returns:

the ClusterNode instance that corresponds to the current node
getCurrentNode
()

Retrieves the ClusterNode instance that corresponds to the current node.

public Collection<ClusterNode>

Returns:

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

Get all the nodes in the cluster

public ClusterScheme

Returns:

a scheme name for the cluster information. Currently TERRACOTTA is the only scheme supported.
getScheme
()

Get scheme name for this cluster info.

public List<ClusterTopologyListener>

Returns:

a list of all the topology listeners
getTopologyListeners
()

Get all the topology listeners

public boolean

Returns:

true if cluster is online otherwise false
isClusterOnline
()

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

public void
removeAllListeners()

Removes all listeners for cluster events

public boolean

Returns:

True if not listening
removeTopologyListener
(ClusterTopologyListener
Listener
listener
)

Remove a listener for cluster events

public ClusterNode

Returns:

the ClusterNode instance that corresponds to the current node
waitUntilNodeJoinsCluster
()

Waits until the current node has successfully joined the cluster.

Method Detail

addTopologyListenerback to summary
public boolean addTopologyListener(ClusterTopologyListener listener)

Add a listener for cluster events

Parameters
listener:ClusterTopologyListener

Listener

Returns:boolean

True if already listening

getCurrentNodeback to summary
public ClusterNode 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()

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()

Get scheme name for this cluster info.

Returns:ClusterScheme

a scheme name for the cluster information. Currently TERRACOTTA is the only scheme supported.

getTopologyListenersback to summary
public List<ClusterTopologyListener> getTopologyListeners()

Get all the topology listeners

Returns:List<ClusterTopologyListener>

a list of all the topology listeners

isClusterOnlineback to summary
public boolean 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()

Removes all listeners for cluster events

removeTopologyListenerback to summary
public boolean removeTopologyListener(ClusterTopologyListener listener)

Remove a listener for cluster events

Parameters
listener:ClusterTopologyListener

Listener

Returns:boolean

True if not listening

waitUntilNodeJoinsClusterback to summary
public ClusterNode waitUntilNodeJoinsCluster()

Waits until the current node has successfully joined the cluster.

Returns:ClusterNode

the ClusterNode instance that corresponds to the current node