|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.codehaus.activecluster.impl.StateServiceImpl
Represents a node list
Nested Class Summary | |
protected static class |
StateServiceImpl.NodeEntry
|
Constructor Summary | |
StateServiceImpl(Cluster cluster,
Object clusterLock,
Runnable localNodePing,
Timer timer,
long inactiveTime)
|
Method Summary | |
void |
addClusterListener(ClusterListener listener)
|
void |
checkForTimeouts()
|
protected void |
coordinatorChanged(Node node)
|
TimerTask |
createTimerTask()
|
protected void |
doElection()
|
ElectionStrategy |
getElectionStrategy()
|
long |
getInactiveTime()
|
Map |
getNodes()
|
protected long |
getTimeMillis()
For performance we may wish to use a less granualar timing mechanism only updating the time every x millis since we're only using the time as a judge of when a node has not pinged for at least a few hundred millis etc. |
void |
keepAlive(Node node)
Sends a keep alive to the cluster |
protected void |
nodeAdded(Node node)
|
protected void |
nodeFailed(Node node)
|
protected void |
nodeUpdated(Node node)
|
void |
removeClusterListener(ClusterListener listener)
|
void |
setElectionStrategy(ElectionStrategy electionStrategy)
set the election strategy |
void |
setInactiveTime(long inactiveTime)
|
void |
shutdown(Node node)
Sends a shutdown message to the cluster |
protected boolean |
stateHasChanged(Node oldNode,
Node newNode)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public StateServiceImpl(Cluster cluster, Object clusterLock, Runnable localNodePing, Timer timer, long inactiveTime)
Method Detail |
public ElectionStrategy getElectionStrategy()
public void setElectionStrategy(ElectionStrategy electionStrategy)
electionStrategy
- public long getInactiveTime()
public void setInactiveTime(long inactiveTime)
public Map getNodes()
public void keepAlive(Node node)
StateService
keepAlive
in interface StateService
node
- public void shutdown(Node node)
StateService
shutdown
in interface StateService
public void checkForTimeouts()
public TimerTask createTimerTask()
public void addClusterListener(ClusterListener listener)
public void removeClusterListener(ClusterListener listener)
protected void nodeAdded(Node node)
protected void nodeUpdated(Node node)
protected void nodeFailed(Node node)
protected void coordinatorChanged(Node node)
protected void doElection()
protected long getTimeMillis()
protected boolean stateHasChanged(Node oldNode, Node newNode)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |