public class TerracottaCacheCluster extends Object implements CacheCluster
CacheCluster
implementation that delegates to an underlying cache cluster. The underlying CacheCluster
can be changed
dynamicallyConstructor and Description |
---|
TerracottaCacheCluster() |
Modifier and Type | Method and Description |
---|---|
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
|
boolean |
removeTopologyListener(ClusterTopologyListener listener)
Remove a listener for cluster events
|
void |
setUnderlyingCacheCluster(CacheCluster newCacheCluster)
Set the underlying cache
|
ClusterNode |
waitUntilNodeJoinsCluster()
Waits until the current node has successfully joined the cluster.
|
public void setUnderlyingCacheCluster(CacheCluster newCacheCluster)
newCacheCluster
- public boolean addTopologyListener(ClusterTopologyListener listener)
addTopologyListener
in interface CacheCluster
listener
- Listenerpublic boolean removeTopologyListener(ClusterTopologyListener listener)
removeTopologyListener
in interface CacheCluster
listener
- Listenerpublic ClusterNode getCurrentNode()
ClusterNode
instance that corresponds to the current node.getCurrentNode
in interface CacheCluster
ClusterNode
instance that corresponds to the current nodepublic Collection<ClusterNode> getNodes()
getNodes
in interface CacheCluster
public ClusterScheme getScheme()
getScheme
in interface CacheCluster
TERRACOTTA
is the only scheme supported.public boolean isClusterOnline()
isClusterOnline
in interface CacheCluster
public ClusterNode waitUntilNodeJoinsCluster()
waitUntilNodeJoinsCluster
in interface CacheCluster
ClusterNode
instance that corresponds to the current nodepublic List<ClusterTopologyListener> getTopologyListeners()
getTopologyListeners
in interface CacheCluster
Copyright © 2003-2013 Terracotta, Inc.. All Rights Reserved.