org.codehaus.wadi.tribes
Class TribesCluster

java.lang.Object
  extended by org.codehaus.wadi.tribes.TribesCluster
All Implemented Interfaces:
org.codehaus.wadi.group.Cluster

public class TribesCluster
extends java.lang.Object
implements org.codehaus.wadi.group.Cluster


Nested Class Summary
protected  class TribesCluster.WadiListener
           
 
Field Summary
protected  org.apache.catalina.tribes.group.GroupChannel channel
           
protected  boolean initialized
           
protected  java.util.List<org.codehaus.wadi.group.ClusterListener> listeners
           
 
Constructor Summary
TribesCluster(byte[] clusterDomain, TribesDispatcher dispatcher, java.lang.String localPeerName, org.codehaus.wadi.group.PeerInfo localPeerinfo)
           
 
Method Summary
 void addClusterListener(org.codehaus.wadi.group.ClusterListener listener)
          addClusterListener
protected  void addStaticMembers(TribesDispatcher dispatcher)
           
 org.codehaus.wadi.group.Address getAddress()
          getAddress
 java.lang.String getClusterName()
           
 org.codehaus.wadi.group.Dispatcher getDispatcher()
           
 long getInactiveTime()
           
 org.codehaus.wadi.group.LocalPeer getLocalPeer()
          getLocalPeer
 int getPeerCount()
          getPeerCount
 org.codehaus.wadi.group.Peer getPeerFromAddress(org.codehaus.wadi.group.Address address)
          getPeerFromAddress
 java.util.Map getRemotePeers()
          getRemotePeers
 void init()
           
 void removeClusterListener(org.codehaus.wadi.group.ClusterListener listener)
          removeClusterListener
 void start()
          start
 void stop()
          stop
 boolean waitOnMembershipCount(int membershipCount, long timeout)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

channel

protected org.apache.catalina.tribes.group.GroupChannel channel

listeners

protected java.util.List<org.codehaus.wadi.group.ClusterListener> listeners

initialized

protected boolean initialized
Constructor Detail

TribesCluster

public TribesCluster(byte[] clusterDomain,
                     TribesDispatcher dispatcher,
                     java.lang.String localPeerName,
                     org.codehaus.wadi.group.PeerInfo localPeerinfo)
Method Detail

getClusterName

public java.lang.String getClusterName()
Specified by:
getClusterName in interface org.codehaus.wadi.group.Cluster

getDispatcher

public org.codehaus.wadi.group.Dispatcher getDispatcher()
Specified by:
getDispatcher in interface org.codehaus.wadi.group.Cluster

addClusterListener

public void addClusterListener(org.codehaus.wadi.group.ClusterListener listener)
addClusterListener

Specified by:
addClusterListener in interface org.codehaus.wadi.group.Cluster
Parameters:
listener - ClusterListener

getAddress

public org.codehaus.wadi.group.Address getAddress()
getAddress

Specified by:
getAddress in interface org.codehaus.wadi.group.Cluster
Returns:
Address

getInactiveTime

public long getInactiveTime()
Returns:
- the number of millis that a Peer may remain silent before being declared suspect/dead..

getLocalPeer

public org.codehaus.wadi.group.LocalPeer getLocalPeer()
getLocalPeer

Specified by:
getLocalPeer in interface org.codehaus.wadi.group.Cluster
Returns:
LocalPeer

getPeerCount

public int getPeerCount()
getPeerCount

Specified by:
getPeerCount in interface org.codehaus.wadi.group.Cluster
Returns:
int

getPeerFromAddress

public org.codehaus.wadi.group.Peer getPeerFromAddress(org.codehaus.wadi.group.Address address)
getPeerFromAddress

Specified by:
getPeerFromAddress in interface org.codehaus.wadi.group.Cluster
Parameters:
address - Address
Returns:
Peer

getRemotePeers

public java.util.Map getRemotePeers()
getRemotePeers

Specified by:
getRemotePeers in interface org.codehaus.wadi.group.Cluster
Returns:
Map

removeClusterListener

public void removeClusterListener(org.codehaus.wadi.group.ClusterListener listener)
removeClusterListener

Specified by:
removeClusterListener in interface org.codehaus.wadi.group.Cluster
Parameters:
listener - ClusterListener

init

public void init()
          throws org.codehaus.wadi.group.ClusterException
Throws:
org.codehaus.wadi.group.ClusterException

start

public void start()
           throws org.codehaus.wadi.group.ClusterException
start

Specified by:
start in interface org.codehaus.wadi.group.Cluster
Throws:
org.codehaus.wadi.group.ClusterException

stop

public void stop()
          throws org.codehaus.wadi.group.ClusterException
stop

Specified by:
stop in interface org.codehaus.wadi.group.Cluster
Throws:
org.codehaus.wadi.group.ClusterException

waitOnMembershipCount

public boolean waitOnMembershipCount(int membershipCount,
                                     long timeout)
                              throws java.lang.InterruptedException
Specified by:
waitOnMembershipCount in interface org.codehaus.wadi.group.Cluster
Parameters:
membershipCount - - when membership reaches this number or we timeout this method will return
timeout - - the number of milliseconds to wait for membership to hit membershipCount
Returns:
whether or not expected membershipCount was hit within given time
Throws:
java.lang.InterruptedException

addStaticMembers

protected void addStaticMembers(TribesDispatcher dispatcher)


Copyright © 2010. All Rights Reserved.