org.codehaus.wadi.gridstate.jgroups
Class JGroupsDispatcher
java.lang.Object
org.codehaus.wadi.gridstate.impl.AbstractDispatcher
org.codehaus.wadi.gridstate.jgroups.JGroupsDispatcher
- All Implemented Interfaces:
- org.codehaus.wadi.gridstate.Dispatcher, org.jgroups.MembershipListener, MessageListener, org.jgroups.MessageListener
- public class JGroupsDispatcher
- extends org.codehaus.wadi.gridstate.impl.AbstractDispatcher
- implements org.jgroups.MessageListener, org.jgroups.MembershipListener
A Dispatcher for JGroups
- Version:
- $Revision: 1363 $
- Author:
- Jules Gosnell
Nested classes inherited from class org.codehaus.wadi.gridstate.Dispatcher |
org.codehaus.wadi.gridstate.Dispatcher.InternalDispatcher |
Fields inherited from class org.codehaus.wadi.gridstate.impl.AbstractDispatcher |
_clusterName, _config, _executor, _factory, _inactiveTime, _log, _map, _messageLog, _nodeName, _rvMap |
Methods inherited from class org.codehaus.wadi.gridstate.impl.AbstractDispatcher |
attemptRendezVous, deregister, exchangeReply, exchangeReplyLoop, exchangeSend, exchangeSend, exchangeSend, exchangeSendLoop, forward, forward, getExecutor, getInactiveTime, getNodeName, getRendezVousMap, newDeregister, newRegister, nextCorrelationId, onMessage, register, register, reply, reply, send, setRendezVous |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
_clusterDestination
protected final Destination _clusterDestination
_clusterState
protected final Map _clusterState
_channel
protected org.jgroups.Channel _channel
_dispatcher
protected org.jgroups.blocks.MessageDispatcher _dispatcher
_localDestination
protected Destination _localDestination
_localState
protected Map _localState
_members
protected Vector _members
_cluster
protected JGroupsCluster _cluster
_viewLock
protected final Object _viewLock
_listener
protected ClusterListener _listener
_nodes
protected final Map _nodes
JGroupsDispatcher
public JGroupsDispatcher(String nodeName,
String clusterName,
long inactiveTime)
receive
public void receive(org.jgroups.Message msg)
- Specified by:
receive
in interface org.jgroups.MessageListener
getState
public byte[] getState()
- Specified by:
getState
in interface org.jgroups.MessageListener
setState
public void setState(byte[] state)
- Specified by:
setState
in interface org.jgroups.MessageListener
init
public void init(org.codehaus.wadi.gridstate.DispatcherConfig config)
throws Exception
- Specified by:
init
in interface org.codehaus.wadi.gridstate.Dispatcher
- Throws:
Exception
start
public void start()
throws Exception
- Specified by:
start
in interface org.codehaus.wadi.gridstate.Dispatcher
- Throws:
Exception
stop
public void stop()
throws Exception
- Specified by:
stop
in interface org.codehaus.wadi.gridstate.Dispatcher
- Throws:
Exception
getNumNodes
public int getNumNodes()
- Specified by:
getNumNodes
in interface org.codehaus.wadi.gridstate.Dispatcher
createObjectMessage
public ObjectMessage createObjectMessage()
- Specified by:
createObjectMessage
in interface org.codehaus.wadi.gridstate.Dispatcher
send
public void send(Destination to,
ObjectMessage message)
throws Exception
- Specified by:
send
in interface org.codehaus.wadi.gridstate.Dispatcher
- Throws:
Exception
getState
protected Map getState(org.jgroups.Address address)
getNodeName
public String getNodeName(Destination destination)
- Specified by:
getNodeName
in interface org.codehaus.wadi.gridstate.Dispatcher
getLocalDestination
public Destination getLocalDestination()
- Specified by:
getLocalDestination
in interface org.codehaus.wadi.gridstate.Dispatcher
getClusterDestination
public Destination getClusterDestination()
- Specified by:
getClusterDestination
in interface org.codehaus.wadi.gridstate.Dispatcher
getDistributedState
public Map getDistributedState()
- Specified by:
getDistributedState
in interface org.codehaus.wadi.gridstate.Dispatcher
setDistributedState
public void setDistributedState(Map state)
throws Exception
- Specified by:
setDistributedState
in interface org.codehaus.wadi.gridstate.Dispatcher
- Throws:
Exception
onMessage
public void onMessage(ObjectMessage message,
JGroupsStateUpdate update)
throws Exception
- Throws:
Exception
getIncomingCorrelationId
public String getIncomingCorrelationId(ObjectMessage message)
throws Exception
- Specified by:
getIncomingCorrelationId
in interface org.codehaus.wadi.gridstate.Dispatcher
- Throws:
Exception
setIncomingCorrelationId
public void setIncomingCorrelationId(ObjectMessage message,
String correlationId)
throws Exception
- Specified by:
setIncomingCorrelationId
in interface org.codehaus.wadi.gridstate.Dispatcher
- Throws:
Exception
getOutgoingCorrelationId
public String getOutgoingCorrelationId(ObjectMessage message)
throws Exception
- Specified by:
getOutgoingCorrelationId
in interface org.codehaus.wadi.gridstate.Dispatcher
- Throws:
Exception
setOutgoingCorrelationId
public void setOutgoingCorrelationId(ObjectMessage message,
String correlationId)
throws Exception
- Specified by:
setOutgoingCorrelationId
in interface org.codehaus.wadi.gridstate.Dispatcher
- Throws:
Exception
findRelevantSessionNames
public void findRelevantSessionNames(int numPartitions,
Collection[] resultSet)
viewAccepted
public void viewAccepted(org.jgroups.View newView)
- Specified by:
viewAccepted
in interface org.jgroups.MembershipListener
suspect
public void suspect(org.jgroups.Address suspected_mbr)
- Specified by:
suspect
in interface org.jgroups.MembershipListener
block
public void block()
- Specified by:
block
in interface org.jgroups.MembershipListener
setClusterListener
public void setClusterListener(ClusterListener listener)
- Specified by:
setClusterListener
in interface org.codehaus.wadi.gridstate.Dispatcher
ensureNode
protected Node ensureNode(org.jgroups.Address address)
Copyright © 2004-2006 Core Developers Network Ltd.. All Rights Reserved.