ehcache

net.sf.ehcache.cluster
Interface CacheCluster

All Known Implementing Classes:
NoopCacheCluster, TerracottaCacheCluster

public interface CacheCluster

Allows you to explore the Terracotta cluster nodes and register for events about the cluster.

Since:
2.0
Author:
Geert Bevin, Abhishek Sanoujam

Method Summary
 boolean addTopologyListener(ClusterTopologyListener listener)
          Add a listener for cluster events
 ClusterNode getCurrentNode()
          Retrieves the ClusterNode instance that corresponds to the current node.
 Collection<ClusterNode> getNodes()
          Get all the nodes in the cluster
 ClusterScheme getScheme()
          Get scheme name for this cluster info.
 List<ClusterTopologyListener> getTopologyListeners()
          Get all the topology listeners
 boolean isClusterOnline()
          Find out if the current node is connected to the cluster or not
 void removeAllListeners()
          Removes all listeners for cluster events
 boolean removeTopologyListener(ClusterTopologyListener listener)
          Remove a listener for cluster events
 ClusterNode waitUntilNodeJoinsCluster()
          Waits until the current node has successfully joined the cluster.
 

Method Detail

getScheme

ClusterScheme getScheme()
Get scheme name for this cluster info.

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

getCurrentNode

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

Returns:
the ClusterNode instance that corresponds to the current node

waitUntilNodeJoinsCluster

ClusterNode waitUntilNodeJoinsCluster()
Waits until the current node has successfully joined the cluster.

Returns:
the ClusterNode instance that corresponds to the current node

getNodes

Collection<ClusterNode> getNodes()
Get all the nodes in the cluster

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

isClusterOnline

boolean isClusterOnline()
Find out if the current node is connected to the cluster or not

Returns:
true if cluster is online otherwise false

addTopologyListener

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

Parameters:
listener - Listener
Returns:
True if already listening

removeTopologyListener

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

Parameters:
listener - Listener
Returns:
True if not listening

removeAllListeners

void removeAllListeners()
Removes all listeners for cluster events


getTopologyListeners

List<ClusterTopologyListener> getTopologyListeners()
Get all the topology listeners

Returns:
a list of all the topology listeners

ehcache

Copyright 2001-2016, Terracotta, Inc.