[jboss-cvs] JBoss Messaging SVN: r1698 - in branches/Branch_Client_Failover_Experiment/src/main/org/jboss: jms/server/connectionfactory messaging/core/plugin/contract messaging/core/plugin/postoffice/cluster
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Sun Dec 3 21:58:22 EST 2006
Author: ovidiu.feodorov at jboss.com
Date: 2006-12-03 21:58:19 -0500 (Sun, 03 Dec 2006)
New Revision: 1698
Modified:
branches/Branch_Client_Failover_Experiment/src/main/org/jboss/jms/server/connectionfactory/ConnectionFactoryJNDIMapper.java
branches/Branch_Client_Failover_Experiment/src/main/org/jboss/messaging/core/plugin/contract/Replicator.java
branches/Branch_Client_Failover_Experiment/src/main/org/jboss/messaging/core/plugin/postoffice/cluster/DefaultClusteredPostOffice.java
Log:
Replicator method name refactoring
Modified: branches/Branch_Client_Failover_Experiment/src/main/org/jboss/jms/server/connectionfactory/ConnectionFactoryJNDIMapper.java
===================================================================
--- branches/Branch_Client_Failover_Experiment/src/main/org/jboss/jms/server/connectionfactory/ConnectionFactoryJNDIMapper.java 2006-12-04 02:38:15 UTC (rev 1697)
+++ branches/Branch_Client_Failover_Experiment/src/main/org/jboss/jms/server/connectionfactory/ConnectionFactoryJNDIMapper.java 2006-12-04 02:58:19 UTC (rev 1698)
@@ -142,7 +142,7 @@
// node will contain an updated list of local delegates, and all ConnectionFactoryJNDIMapper
// will rebind updated ConnectionFactories in JNDI.
- replicator.putReplicant(CF_PREFIX + uniqueName, localDelegate);
+ replicator.put(CF_PREFIX + uniqueName, localDelegate);
}
public synchronized void unregisterConnectionFactory(String uniqueName, boolean clustered) throws Exception
@@ -185,7 +185,7 @@
if (replicator != null)
{
//There may be no clustered post office deployed
- replicator.removeReplicant(CF_PREFIX + uniqueName);
+ replicator.remove(CF_PREFIX + uniqueName);
}
}
Modified: branches/Branch_Client_Failover_Experiment/src/main/org/jboss/messaging/core/plugin/contract/Replicator.java
===================================================================
--- branches/Branch_Client_Failover_Experiment/src/main/org/jboss/messaging/core/plugin/contract/Replicator.java 2006-12-04 02:38:15 UTC (rev 1697)
+++ branches/Branch_Client_Failover_Experiment/src/main/org/jboss/messaging/core/plugin/contract/Replicator.java 2006-12-04 02:58:19 UTC (rev 1698)
@@ -35,6 +35,7 @@
* Then, for that key, there is an entry for each node id.
*
* @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
+ * @author <a href="mailto:ovidiu at jboss.org">Ovidiu Feodorov</a>
* @version <tt>$Revision: 1.1 $</tt>
*
* $Id$
@@ -42,20 +43,34 @@
*/
public interface Replicator
{
- void putReplicant(Serializable key, Serializable replicant) throws Exception;
-
- boolean removeReplicant(Serializable key) throws Exception;
+ /**
+ * Broadcast data across the cluster, updating replication maps on all nodes, including the local
+ * node.
+ */
+ void put(Serializable key, Serializable data) throws Exception;
/**
- * @return an empty map if no replicants are found for 'key', but never null.
+ * Return a node-mapped replicated data.
+ *
+ * @return a Map<Integer(nodeID)-data>. Returns an empty map if no replicants are found for
+ * 'key', but never null.
*/
- Map getReplicants(Serializable key) throws Exception;
-
+ Map get(Serializable key) throws Exception;
+
+ /**
+ * Updates the replication maps across the cluster by removing the data corresponding to the give
+ * key. Only the data corresponding to the current node is removed.
+ */
+ boolean remove(Serializable key) throws Exception;
+
void registerListener(ReplicationListener listener);
void unregisterListener(ReplicationListener listener);
/**
+ * TODO - this method doesn't belong here, as no semantics should be associated with data at this
+ * level
+ *
* Gets the current failover node ID for the specified node ID.
*
* @param nodeID - The node to get the failover node id for.
Modified: branches/Branch_Client_Failover_Experiment/src/main/org/jboss/messaging/core/plugin/postoffice/cluster/DefaultClusteredPostOffice.java
===================================================================
--- branches/Branch_Client_Failover_Experiment/src/main/org/jboss/messaging/core/plugin/postoffice/cluster/DefaultClusteredPostOffice.java 2006-12-04 02:38:15 UTC (rev 1697)
+++ branches/Branch_Client_Failover_Experiment/src/main/org/jboss/messaging/core/plugin/postoffice/cluster/DefaultClusteredPostOffice.java 2006-12-04 02:58:19 UTC (rev 1698)
@@ -340,7 +340,7 @@
PostOfficeAddressInfo info = new PostOfficeAddressInfo(syncAddress, asyncAddress);
- putReplicant(ADDRESS_INFO_KEY, info);
+ put(ADDRESS_INFO_KEY, info);
statsSender.start();
@@ -617,7 +617,7 @@
// Replicator implementation --------------------------------------------------------------------------
- public Map getReplicants(Serializable key) throws Exception
+ public Map get(Serializable key) throws Exception
{
lock.readLock().acquire();
@@ -633,7 +633,7 @@
}
}
- public void putReplicant(Serializable key, Serializable replicant) throws Exception
+ public void put(Serializable key, Serializable replicant) throws Exception
{
putReplicantLocally(nodeId, key, replicant);
@@ -642,7 +642,7 @@
syncSendRequest(request);
}
- public boolean removeReplicant(Serializable key) throws Exception
+ public boolean remove(Serializable key) throws Exception
{
if (removeReplicantLocally(this.nodeId, key))
{
@@ -1849,7 +1849,7 @@
lock.readLock().acquire();
try
{
- Map map = getReplicants(ADDRESS_INFO_KEY);
+ Map map = get(ADDRESS_INFO_KEY);
if (map == null)
{
@@ -2031,7 +2031,7 @@
try
{
- Map map = this.getReplicants(ADDRESS_INFO_KEY);
+ Map map = this.get(ADDRESS_INFO_KEY);
if (map == null)
{
More information about the jboss-cvs-commits
mailing list