org.codehaus.wadi.tribes
Class TribesCluster

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

public class TribesCluster
extends java.lang.Object
implements 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<ClusterListener> listeners
           
 
Constructor Summary
TribesCluster(byte[] clusterDomain, TribesDispatcher dispatcher, java.lang.String localPeerName, PeerInfo localPeerinfo)
           
TribesCluster(byte[] clusterDomain, TribesDispatcher dispatcher, java.lang.String localPeerName, PeerInfo localPeerinfo, boolean disableMulticasting, java.util.Properties mcastServiceProperties, int receiverPort)
           
 
Method Summary
 void addClusterListener(ClusterListener listener)
          addClusterListener
protected  void addStaticMembers(TribesDispatcher dispatcher)
           
protected  void ensurePreferIPv4StackPropertyIsSet()
           
 Address getAddress()
          getAddress
 java.lang.String getClusterName()
           
 Dispatcher getDispatcher()
           
 long getInactiveTime()
           
 LocalPeer getLocalPeer()
          getLocalPeer
 int getPeerCount()
          getPeerCount
 Peer getPeerFromAddress(Address address)
          getPeerFromAddress
 java.util.Map<Address,Peer> getRemotePeers()
          getRemotePeers
 void init()
           
 void removeClusterListener(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<ClusterListener> listeners

initialized

protected boolean initialized
Constructor Detail

TribesCluster

public TribesCluster(byte[] clusterDomain,
                     TribesDispatcher dispatcher,
                     java.lang.String localPeerName,
                     PeerInfo localPeerinfo)

TribesCluster

public TribesCluster(byte[] clusterDomain,
                     TribesDispatcher dispatcher,
                     java.lang.String localPeerName,
                     PeerInfo localPeerinfo,
                     boolean disableMulticasting,
                     java.util.Properties mcastServiceProperties,
                     int receiverPort)
Method Detail

getClusterName

public java.lang.String getClusterName()
Specified by:
getClusterName in interface Cluster

getDispatcher

public Dispatcher getDispatcher()
Specified by:
getDispatcher in interface Cluster

addClusterListener

public void addClusterListener(ClusterListener listener)
addClusterListener

Specified by:
addClusterListener in interface Cluster
Parameters:
listener - ClusterListener

getAddress

public Address getAddress()
getAddress

Specified by:
getAddress in interface 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 LocalPeer getLocalPeer()
getLocalPeer

Specified by:
getLocalPeer in interface Cluster
Returns:
LocalPeer

getPeerCount

public int getPeerCount()
getPeerCount

Specified by:
getPeerCount in interface Cluster
Returns:
int

getPeerFromAddress

public Peer getPeerFromAddress(Address address)
getPeerFromAddress

Specified by:
getPeerFromAddress in interface Cluster
Parameters:
address - Address
Returns:
Peer

getRemotePeers

public java.util.Map<Address,Peer> getRemotePeers()
getRemotePeers

Specified by:
getRemotePeers in interface Cluster
Returns:
Map

removeClusterListener

public void removeClusterListener(ClusterListener listener)
removeClusterListener

Specified by:
removeClusterListener in interface Cluster
Parameters:
listener - ClusterListener

init

public void init()
          throws ClusterException
Throws:
ClusterException

ensurePreferIPv4StackPropertyIsSet

protected void ensurePreferIPv4StackPropertyIsSet()

start

public void start()
           throws ClusterException
start

Specified by:
start in interface Cluster
Throws:
ClusterException

stop

public void stop()
          throws ClusterException
stop

Specified by:
stop in interface Cluster
Throws:
ClusterException

waitOnMembershipCount

public boolean waitOnMembershipCount(int membershipCount,
                                     long timeout)
                              throws java.lang.InterruptedException
Specified by:
waitOnMembershipCount in interface 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.