org.codehaus.wadi.gridstate.activecluster
Class ActiveClusterDispatcher

java.lang.Object
  extended byorg.codehaus.wadi.gridstate.impl.AbstractDispatcher
      extended byorg.codehaus.wadi.gridstate.activecluster.ActiveClusterDispatcher
All Implemented Interfaces:
Dispatcher, MessageListener

public class ActiveClusterDispatcher
extends AbstractDispatcher

A Dispatcher for ActiveCluster

Version:
$Revision: 1430 $
Author:
Jules Gosnell

Nested Class Summary
 
Nested classes inherited from class org.codehaus.wadi.gridstate.Dispatcher
Dispatcher.InternalDispatcher
 
Field Summary
protected  Cluster _cluster
           
protected  MessageConsumer _clusterConsumer
           
 CustomClusterFactory _clusterFactory
           
protected  String _clusterUri
           
protected  org.activemq.ActiveMQConnectionFactory _connectionFactory
           
protected static String _incomingCorrelationIdKey
           
protected  MessageConsumer _nodeConsumer
           
protected static String _outgoingCorrelationIdKey
           
 
Fields inherited from class org.codehaus.wadi.gridstate.impl.AbstractDispatcher
_clusterName, _config, _executor, _factory, _inactiveTime, _log, _map, _messageLog, _nodeName, _rvMap
 
Constructor Summary
ActiveClusterDispatcher(String nodeName, String clusterName, String clusterUri, long inactiveTime)
           
 
Method Summary
 MessageConsumer addDestination(Destination destination)
           
 ObjectMessage createObjectMessage()
           
 void findRelevantSessionNames(int numPartitions, Collection[] resultSet)
           
 Cluster getCluster()
           
 Destination getClusterDestination()
           
 Map getDistributedState()
           
 String getIncomingCorrelationId(ObjectMessage message)
           
 Destination getLocalDestination()
           
 String getNodeName(Destination destination)
           
 int getNumNodes()
           
 String getOutgoingCorrelationId(ObjectMessage message)
           
 void init(DispatcherConfig config)
           
 void removeDestination(MessageConsumer consumer)
           
 void send(Destination to, ObjectMessage message)
           
 void setClusterListener(ClusterListener listener)
           
 void setDistributedState(Map state)
           
 void setIncomingCorrelationId(ObjectMessage message, String id)
           
 void setOutgoingCorrelationId(ObjectMessage message, String id)
           
 void start()
           
 void stop()
           
 
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
 

Field Detail

_incomingCorrelationIdKey

protected static String _incomingCorrelationIdKey

_outgoingCorrelationIdKey

protected static String _outgoingCorrelationIdKey

_cluster

protected Cluster _cluster

_clusterConsumer

protected MessageConsumer _clusterConsumer

_nodeConsumer

protected MessageConsumer _nodeConsumer

_clusterUri

protected final String _clusterUri

_connectionFactory

protected org.activemq.ActiveMQConnectionFactory _connectionFactory

_clusterFactory

public CustomClusterFactory _clusterFactory
Constructor Detail

ActiveClusterDispatcher

public ActiveClusterDispatcher(String nodeName,
                               String clusterName,
                               String clusterUri,
                               long inactiveTime)
Method Detail

getCluster

public Cluster getCluster()

addDestination

public MessageConsumer addDestination(Destination destination)
                               throws JMSException
Throws:
JMSException

removeDestination

public void removeDestination(MessageConsumer consumer)
                       throws JMSException
Throws:
JMSException

init

public void init(DispatcherConfig config)
          throws Exception
Specified by:
init in interface Dispatcher
Overrides:
init in class AbstractDispatcher
Throws:
Exception

start

public void start()
           throws Exception
Throws:
Exception

stop

public void stop()
          throws Exception
Throws:
Exception

getNumNodes

public int getNumNodes()

createObjectMessage

public ObjectMessage createObjectMessage()
                                  throws Exception
Throws:
Exception

send

public void send(Destination to,
                 ObjectMessage message)
          throws Exception
Throws:
Exception

getLocalDestination

public Destination getLocalDestination()

getClusterDestination

public Destination getClusterDestination()

getDistributedState

public Map getDistributedState()

setDistributedState

public void setDistributedState(Map state)
                         throws Exception
Throws:
Exception

getNodeName

public String getNodeName(Destination destination)

getIncomingCorrelationId

public String getIncomingCorrelationId(ObjectMessage message)
                                throws Exception
Throws:
Exception

setIncomingCorrelationId

public void setIncomingCorrelationId(ObjectMessage message,
                                     String id)
                              throws JMSException
Throws:
JMSException

getOutgoingCorrelationId

public String getOutgoingCorrelationId(ObjectMessage message)
                                throws JMSException
Throws:
JMSException

setOutgoingCorrelationId

public void setOutgoingCorrelationId(ObjectMessage message,
                                     String id)
                              throws JMSException
Throws:
JMSException

findRelevantSessionNames

public void findRelevantSessionNames(int numPartitions,
                                     Collection[] resultSet)

setClusterListener

public void setClusterListener(ClusterListener listener)


Copyright © 2004-2008 Core Developers Network Ltd.. All Rights Reserved.