[jboss-cvs] JBoss Messaging SVN: r1548 - in branches/Branch_Client_Failover_Experiment/src/main/org/jboss: jms/client/container jms/server/destination jms/server/endpoint messaging/core/plugin/contract messaging/core/plugin/postoffice messaging/core/plugin/postoffice/cluster
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Thu Nov 2 15:20:14 EST 2006
Author: clebert.suconic at jboss.com
Date: 2006-11-02 15:20:07 -0500 (Thu, 02 Nov 2006)
New Revision: 1548
Modified:
branches/Branch_Client_Failover_Experiment/src/main/org/jboss/jms/client/container/ConnectionAspect.java
branches/Branch_Client_Failover_Experiment/src/main/org/jboss/jms/server/destination/QueueService.java
branches/Branch_Client_Failover_Experiment/src/main/org/jboss/jms/server/endpoint/ServerConnectionEndpoint.java
branches/Branch_Client_Failover_Experiment/src/main/org/jboss/jms/server/endpoint/ServerConsumerEndpoint.java
branches/Branch_Client_Failover_Experiment/src/main/org/jboss/jms/server/endpoint/ServerSessionEndpoint.java
branches/Branch_Client_Failover_Experiment/src/main/org/jboss/messaging/core/plugin/contract/ClusteredPostOffice.java
branches/Branch_Client_Failover_Experiment/src/main/org/jboss/messaging/core/plugin/contract/PostOffice.java
branches/Branch_Client_Failover_Experiment/src/main/org/jboss/messaging/core/plugin/postoffice/DefaultPostOffice.java
branches/Branch_Client_Failover_Experiment/src/main/org/jboss/messaging/core/plugin/postoffice/cluster/DefaultClusteredPostOffice.java
Log:
http://jira.jboss.org/jira/browse/JBMESSAGING-519 - Removing nodeId from PostOffice signature as channels are being transfered now (these signatures are not needed any more)
Modified: branches/Branch_Client_Failover_Experiment/src/main/org/jboss/jms/client/container/ConnectionAspect.java
===================================================================
--- branches/Branch_Client_Failover_Experiment/src/main/org/jboss/jms/client/container/ConnectionAspect.java 2006-11-02 17:15:00 UTC (rev 1547)
+++ branches/Branch_Client_Failover_Experiment/src/main/org/jboss/jms/client/container/ConnectionAspect.java 2006-11-02 20:20:07 UTC (rev 1548)
@@ -357,7 +357,7 @@
failedConsumerState.getSubscriptionName(),
false,
failedConsumerDelegate.getChannelId(),
- failedConnectionState.getServerID());
+ oldServerID);
if (trace) { log.trace("handleFailoverOnConsumer: alternate consumer created"); }
Modified: branches/Branch_Client_Failover_Experiment/src/main/org/jboss/jms/server/destination/QueueService.java
===================================================================
--- branches/Branch_Client_Failover_Experiment/src/main/org/jboss/jms/server/destination/QueueService.java 2006-11-02 17:15:00 UTC (rev 1547)
+++ branches/Branch_Client_Failover_Experiment/src/main/org/jboss/jms/server/destination/QueueService.java 2006-11-02 20:20:07 UTC (rev 1548)
@@ -88,7 +88,7 @@
//Binding might already exist
- Binding binding = postOffice.getBindingForQueueName(-1,destination.getName());
+ Binding binding = postOffice.getBindingForQueueName(destination.getName());
if (binding != null)
{
@@ -112,7 +112,7 @@
executor, null,
destination.getFullSize(), destination.getPageSize(), destination.getDownCacheSize());
- postOffice.bindQueue(-1,destination.getName(), queue);
+ postOffice.bindQueue(destination.getName(), queue);
}
else
{
@@ -124,11 +124,11 @@
if (destination.isClustered())
{
- cpo.bindClusteredQueue(-1,destination.getName(), (LocalClusteredQueue)queue);
+ cpo.bindClusteredQueue(destination.getName(), (LocalClusteredQueue)queue);
}
else
{
- cpo.bindQueue(-1,destination.getName(), (LocalClusteredQueue)queue);
+ cpo.bindQueue(destination.getName(), (LocalClusteredQueue)queue);
}
}
}
@@ -156,7 +156,7 @@
dm.unregisterDestination(destination);
//We undeploy the queue from memory - this also deactivates the binding
- Binding binding = postOffice.getBindingForQueueName(-1,destination.getName());
+ Binding binding = postOffice.getBindingForQueueName(destination.getName());
PagingFilteredQueue queue = (PagingFilteredQueue)binding.getQueue();
Modified: branches/Branch_Client_Failover_Experiment/src/main/org/jboss/jms/server/endpoint/ServerConnectionEndpoint.java
===================================================================
--- branches/Branch_Client_Failover_Experiment/src/main/org/jboss/jms/server/endpoint/ServerConnectionEndpoint.java 2006-11-02 17:15:00 UTC (rev 1547)
+++ branches/Branch_Client_Failover_Experiment/src/main/org/jboss/jms/server/endpoint/ServerConnectionEndpoint.java 2006-11-02 20:20:07 UTC (rev 1548)
@@ -307,7 +307,7 @@
if (dest.isQueue())
{
- queuePostOffice.unbindQueue(-1,dest.getName());
+ queuePostOffice.unbindQueue(dest.getName());
}
else
{
Modified: branches/Branch_Client_Failover_Experiment/src/main/org/jboss/jms/server/endpoint/ServerConsumerEndpoint.java
===================================================================
--- branches/Branch_Client_Failover_Experiment/src/main/org/jboss/jms/server/endpoint/ServerConsumerEndpoint.java 2006-11-02 17:15:00 UTC (rev 1547)
+++ branches/Branch_Client_Failover_Experiment/src/main/org/jboss/jms/server/endpoint/ServerConsumerEndpoint.java 2006-11-02 20:20:07 UTC (rev 1548)
@@ -371,7 +371,7 @@
PostOffice topicPostOffice =
sessionEndpoint.getConnectionEndpoint().getServerPeer().getTopicPostOfficeInstance();
- Binding binding = topicPostOffice.getBindingForQueueName(nodeId,queueName);
+ Binding binding = topicPostOffice.getBindingForQueueName(queueName);
//Note binding can be null since there can many competing subscribers for the subscription -
//in which case the first will have removed the subscription and subsequently
@@ -379,7 +379,7 @@
if (binding != null && !binding.getQueue().isRecoverable())
{
- topicPostOffice.unbindQueue(nodeId, queueName);
+ topicPostOffice.unbindQueue(queueName);
}
}
Modified: branches/Branch_Client_Failover_Experiment/src/main/org/jboss/jms/server/endpoint/ServerSessionEndpoint.java
===================================================================
--- branches/Branch_Client_Failover_Experiment/src/main/org/jboss/jms/server/endpoint/ServerSessionEndpoint.java 2006-11-02 17:15:00 UTC (rev 1547)
+++ branches/Branch_Client_Failover_Experiment/src/main/org/jboss/jms/server/endpoint/ServerSessionEndpoint.java 2006-11-02 20:20:07 UTC (rev 1548)
@@ -149,7 +149,7 @@
if (nodeId < 0) nodeId = this.nodeId;
- if (nodeId != this.nodeId)
+ if (nodeId != this.nodeId) // this is temporary
{
try
{
@@ -243,7 +243,7 @@
mDest.getPageSize(),
mDest.getDownCacheSize());
- binding = topicPostOffice.bindQueue(nodeId, jmsDestination.getName(), q);
+ binding = topicPostOffice.bindQueue(jmsDestination.getName(), q);
}
else
{
@@ -257,11 +257,11 @@
if (mDest.isClustered())
{
- binding = cpo.bindClusteredQueue(nodeId,jmsDestination.getName(), (LocalClusteredQueue)q);
+ binding = cpo.bindClusteredQueue(jmsDestination.getName(), (LocalClusteredQueue)q);
}
else
{
- binding = cpo.bindQueue(nodeId,jmsDestination.getName(), q);
+ binding = cpo.bindQueue(jmsDestination.getName(), q);
}
}
}
@@ -283,7 +283,7 @@
String name = MessageQueueNameHelper.createSubscriptionName(clientID, subscriptionName);
- binding = topicPostOffice.getBindingForQueueName(nodeId,name);
+ binding = topicPostOffice.getBindingForQueueName(name);
if (binding == null)
{
@@ -302,7 +302,7 @@
mDest.getPageSize(),
mDest.getDownCacheSize());
- binding = topicPostOffice.bindQueue(nodeId,jmsDestination.getName(), q);
+ binding = topicPostOffice.bindQueue(jmsDestination.getName(), q);
}
else
{
@@ -316,11 +316,11 @@
if (mDest.isClustered())
{
- binding = cpo.bindClusteredQueue(nodeId,jmsDestination.getName(), (LocalClusteredQueue)q);
+ binding = cpo.bindClusteredQueue(jmsDestination.getName(), (LocalClusteredQueue)q);
}
else
{
- binding = cpo.bindQueue(nodeId,jmsDestination.getName(), q);
+ binding = cpo.bindQueue(jmsDestination.getName(), q);
}
}
}
@@ -360,11 +360,11 @@
{
ClusteredPostOffice cpo = (ClusteredPostOffice)topicPostOffice;
- cpo.unbindClusteredQueue(nodeId,name);
+ cpo.unbindClusteredQueue(name);
}
else
{
- topicPostOffice.unbindQueue(nodeId,name);
+ topicPostOffice.unbindQueue(name);
}
// create a fresh new subscription
@@ -379,7 +379,7 @@
mDest.getFullSize(),
mDest.getPageSize(),
mDest.getDownCacheSize());
- binding = topicPostOffice.bindQueue(nodeId,jmsDestination.getName(), q);
+ binding = topicPostOffice.bindQueue(jmsDestination.getName(), q);
}
else
{
@@ -393,11 +393,11 @@
if (mDest.isClustered())
{
- binding = cpo.bindClusteredQueue(nodeId,jmsDestination.getName(), (LocalClusteredQueue)q);
+ binding = cpo.bindClusteredQueue(jmsDestination.getName(), (LocalClusteredQueue)q);
}
else
{
- binding = cpo.bindQueue(nodeId,jmsDestination.getName(), (LocalClusteredQueue)q);
+ binding = cpo.bindQueue(jmsDestination.getName(), (LocalClusteredQueue)q);
}
}
}
@@ -409,7 +409,7 @@
//Consumer on a jms queue
//Let's find the binding
- binding = queuePostOffice.getBindingForQueueName(nodeId,jmsDestination.getName());
+ binding = queuePostOffice.getBindingForQueueName(jmsDestination.getName());
if (binding == null)
{
@@ -479,7 +479,7 @@
throw new InvalidDestinationException("No such destination: " + jmsDestination);
}
- Binding binding = queuePostOffice.getBindingForQueueName(-1,jmsDestination.getName()); // todo
+ Binding binding = queuePostOffice.getBindingForQueueName(jmsDestination.getName()); // todo
int browserID = connectionEndpoint.getServerPeer().getNextObjectID();
@@ -718,7 +718,7 @@
//Make a binding for this queue
- queuePostOffice.bindQueue(-1,dest.getName(), q);
+ queuePostOffice.bindQueue(dest.getName(), q);
}
}
catch (Throwable t)
@@ -751,7 +751,7 @@
if (dest.isQueue())
{
//Unbind
- queuePostOffice.unbindQueue(-1,dest.getName());
+ queuePostOffice.unbindQueue(dest.getName());
}
else
{
@@ -798,7 +798,7 @@
String queueName = MessageQueueNameHelper.createSubscriptionName(clientID, subscriptionName);
- Binding binding = topicPostOffice.getBindingForQueueName(-1,queueName);
+ Binding binding = topicPostOffice.getBindingForQueueName(queueName);
if (binding == null)
{
@@ -828,11 +828,11 @@
{
ClusteredPostOffice cpo = (ClusteredPostOffice)topicPostOffice;
- cpo.unbindClusteredQueue(-1,queueName);
+ cpo.unbindClusteredQueue(queueName);
}
else
{
- topicPostOffice.unbindQueue(-1,queueName);
+ topicPostOffice.unbindQueue(queueName);
}
}
catch (Throwable t)
Modified: branches/Branch_Client_Failover_Experiment/src/main/org/jboss/messaging/core/plugin/contract/ClusteredPostOffice.java
===================================================================
--- branches/Branch_Client_Failover_Experiment/src/main/org/jboss/messaging/core/plugin/contract/ClusteredPostOffice.java 2006-11-02 17:15:00 UTC (rev 1547)
+++ branches/Branch_Client_Failover_Experiment/src/main/org/jboss/messaging/core/plugin/contract/ClusteredPostOffice.java 2006-11-02 20:20:07 UTC (rev 1548)
@@ -46,7 +46,6 @@
* @return
* @throws Exception
*/
- Binding bindClusteredQueue(int nodeId, String condition, LocalClusteredQueue queue) throws Exception;
Binding bindClusteredQueue(String condition, LocalClusteredQueue queue) throws Exception;
/**
@@ -55,7 +54,6 @@
* @return
* @throws Throwable
*/
- Binding unbindClusteredQueue(int nodeId, String queueName) throws Throwable;
Binding unbindClusteredQueue(String queueName) throws Throwable;
Collection listAllBindingsForCondition(String condition) throws Exception;
Modified: branches/Branch_Client_Failover_Experiment/src/main/org/jboss/messaging/core/plugin/contract/PostOffice.java
===================================================================
--- branches/Branch_Client_Failover_Experiment/src/main/org/jboss/messaging/core/plugin/contract/PostOffice.java 2006-11-02 17:15:00 UTC (rev 1547)
+++ branches/Branch_Client_Failover_Experiment/src/main/org/jboss/messaging/core/plugin/contract/PostOffice.java 2006-11-02 20:20:07 UTC (rev 1548)
@@ -50,12 +50,10 @@
public interface PostOffice extends MessagingComponent
{
Binding bindQueue(String condition, Queue queue) throws Exception;
- Binding bindQueue(int nodeID,String condition, Queue queue) throws Exception;
-
+
Binding unbindQueue(String queueName) throws Throwable;
- Binding unbindQueue(int nodeID,String queueName) throws Throwable;
-
+
/**
* List the bindings that match the specified condition
* @param condition
@@ -70,7 +68,6 @@
* @return
* @throws Exception
*/
- Binding getBindingForQueueName(int nodeID, String queueName) throws Exception;
Binding getBindingForQueueName(String queueName) throws Exception;
Binding getBindingforChannelId(int parameterNodeId, long channelId) throws Exception;
Modified: branches/Branch_Client_Failover_Experiment/src/main/org/jboss/messaging/core/plugin/postoffice/DefaultPostOffice.java
===================================================================
--- branches/Branch_Client_Failover_Experiment/src/main/org/jboss/messaging/core/plugin/postoffice/DefaultPostOffice.java 2006-11-02 17:15:00 UTC (rev 1547)
+++ branches/Branch_Client_Failover_Experiment/src/main/org/jboss/messaging/core/plugin/postoffice/DefaultPostOffice.java 2006-11-02 20:20:07 UTC (rev 1548)
@@ -157,11 +157,6 @@
public Binding bindQueue(String condition, Queue queue) throws Exception
{
- return bindQueue(-1,condition,queue);
- }
- public Binding bindQueue(int parameterNodeId, String condition, Queue queue) throws Exception
- {
- if (parameterNodeId<0) parameterNodeId=this.nodeId;
if (trace) { log.trace(this + " binding queue " + queue.getName() + " with condition " + condition); }
if (queue.getName() == null)
@@ -179,7 +174,7 @@
try
{
//We currently only allow one binding per name per node
- Map nameMap = (Map)nameMaps.get(new Integer(parameterNodeId));
+ Map nameMap = (Map)nameMaps.get(new Integer(nodeId));
Binding binding = null;
@@ -193,7 +188,7 @@
throw new IllegalArgumentException("Binding already exists for name " + queue.getName());
}
- binding = new DefaultBinding(parameterNodeId, condition, queue);
+ binding = new DefaultBinding(nodeId, condition, queue);
addBinding(binding);
@@ -211,13 +206,8 @@
}
}
- public Binding unbindQueue(String queueName) throws Throwable
+ public Binding unbindQueue( String queueName) throws Throwable
{
- return unbindQueue(-1,queueName);
- }
- public Binding unbindQueue(int parameterNodeId, String queueName) throws Throwable
- {
- if (parameterNodeId<0) parameterNodeId=this.nodeId;
if (trace) { log.trace(this + " unbinding queue " + queueName); }
if (queueName == null)
@@ -229,13 +219,13 @@
try
{
- Binding binding = removeBinding(parameterNodeId, queueName);
+ Binding binding = removeBinding(nodeId,queueName);
if (binding.getQueue().isRecoverable())
{
//Need to remove from db too
- deleteBinding(parameterNodeId, binding.getQueue().getName());
+ deleteBinding(nodeId, binding.getQueue().getName());
}
binding.getQueue().removeAllReferences();
@@ -257,13 +247,7 @@
public Binding getBindingForQueueName(String queueName) throws Exception
- {
- return getBindingForQueueName(-1,queueName);
- }
- public Binding getBindingForQueueName(int parameterNodeId, String queueName) throws Exception
{
- log.info("DefaultPostOffice::getBindingForQueueName(" + parameterNodeId + " ," + queueName + ")");
- if (parameterNodeId<0) parameterNodeId=this.nodeId;
if (queueName == null)
{
throw new IllegalArgumentException("Queue name is null");
@@ -273,7 +257,7 @@
try
{
- Map nameMap = (Map)nameMaps.get(new Integer(parameterNodeId));
+ Map nameMap = (Map)nameMaps.get(new Integer(nodeId));
Binding binding = null;
@@ -298,8 +282,8 @@
public Binding getBindingforChannelId(int parameterNodeId, long channelId) throws Exception
{
- log.info("DefaultPostOffice::getBindingforChannelId(" + parameterNodeId + " ," + channelId + ")");
if (parameterNodeId<0) parameterNodeId=this.nodeId;
+ log.info("DefaultPostOffice::getBindingforChannelId(" + parameterNodeId + " ," + channelId + ")");
lock.readLock().acquire();
@@ -515,7 +499,7 @@
log.info("PostOffice " + this.officeName + " nodeId=" + nodeId + " condition=" + condition + " queueName=" + queueName + " channelId=" + channelId + " selector=" + selector);
- Binding binding = this.createBinding(nodeId, nodeId, condition, queueName, channelId, selector, true);
+ Binding binding = this.createBinding(nodeId, condition, queueName, channelId, selector, true);
binding.getQueue().deactivate();
addBinding(binding);
@@ -541,15 +525,15 @@
}
}
- protected Binding createBinding(int bindingNodeId, int nodeId, String condition, String queueName, long channelId, String filterString, boolean durable) throws Exception
+ protected Binding createBinding(int nodeId, String condition, String queueName, long channelId, String filterString, boolean durable) throws Exception
{
Filter filter = filterFactory.createFilter(filterString);
- return createBinding(bindingNodeId,nodeId, condition, queueName, channelId, filter, durable);
+ return createBinding(nodeId, condition, queueName, channelId, filter, durable);
}
- protected Binding createBinding(int bindingNodeId,int nodeId, String condition, String queueName, long channelId, Filter filter, boolean durable)
+ protected Binding createBinding(int nodeId, String condition, String queueName, long channelId, Filter filter, boolean durable)
{
Queue queue;
if (nodeId == this.nodeId)
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-11-02 17:15:00 UTC (rev 1547)
+++ branches/Branch_Client_Failover_Experiment/src/main/org/jboss/messaging/core/plugin/postoffice/cluster/DefaultClusteredPostOffice.java 2006-11-02 20:20:07 UTC (rev 1548)
@@ -319,11 +319,6 @@
public Binding bindClusteredQueue(String condition, LocalClusteredQueue queue) throws Exception
{
- return bindClusteredQueue(-1,condition,queue);
- }
- public Binding bindClusteredQueue(int parameterNodeId, String condition, LocalClusteredQueue queue) throws Exception
- {
- if (parameterNodeId<0) parameterNodeId=this.nodeId;
if (trace)
{
log.trace(this.nodeId + " binding clustered queue: " + queue + " with condition: " + condition);
@@ -336,10 +331,10 @@
// todo what to do when HA failing?
}
- Binding binding = (Binding)super.bindQueue(parameterNodeId,condition, queue);
+ Binding binding = (Binding)super.bindQueue(condition, queue);
BindRequest request =
- new BindRequest(parameterNodeId, queue.getName(), condition, queue.getFilter() == null ? null : queue.getFilter().getFilterString(),
+ new BindRequest(this.nodeId, queue.getName(), condition, queue.getFilter() == null ? null : queue.getFilter().getFilterString(),
binding.getQueue().getChannelID(), queue.isRecoverable());
syncSendRequest(request);
@@ -348,20 +343,15 @@
}
public Binding unbindClusteredQueue(String queueName) throws Throwable
- {
- return unbindClusteredQueue(-1,queueName);
- }
- public Binding unbindClusteredQueue(int parameterNodeId,String queueName) throws Throwable
{
- if (parameterNodeId<0) parameterNodeId=this.nodeId;
if (trace)
{
log.trace(this.nodeId + " unbind clustered queue: " + queueName);
}
- Binding binding = (Binding)super.unbindQueue(parameterNodeId,queueName);
+ Binding binding = (Binding)super.unbindQueue(queueName);
- UnbindRequest request = new UnbindRequest(parameterNodeId, queueName);
+ UnbindRequest request = new UnbindRequest(this.nodeId, queueName);
syncSendRequest(request);
@@ -591,7 +581,7 @@
throw new IllegalArgumentException(this.nodeId + " Binding already exists for node Id " + nodeId + " queue name " + queueName);
}
- binding = this.createBinding(nodeId,nodeId, condition, queueName, channelID, filterString, durable);
+ binding = this.createBinding(nodeId, condition, queueName, channelID, filterString, durable);
addBinding(binding);
}
@@ -1133,7 +1123,9 @@
// todo: remove Binding from cluster
- Binding newBinding = this.createBinding(this.nodeId,this.nodeId,binding.getCondition(),stub.getName(),stub.getChannelID(),stub.getFilter(),stub.isRecoverable());
+ Binding newBinding = this.createBinding(this.nodeId,binding.getCondition(),
+ stub.getName(),stub.getChannelID(),
+ stub.getFilter(),stub.isRecoverable());
insertBinding(newBinding);
@@ -1290,29 +1282,17 @@
}
}
- /**
- *
- * @param bindingNodeId Where the message is originated from. sourceNodeId and nodeId might be different when a recovery recreate Client is being called
- * @param nodeId The owner of the queue.
- * @param condition
- * @param queueName
- * @param channelId
- * @param filterString
- * @param durable
- * @return
- * @throws Exception
- */
- protected Binding createBinding(int bindingNodeId,int nodeId, String condition, String queueName, long channelId, String filterString, boolean durable) throws Exception
+ protected Binding createBinding(int nodeId, String condition, String queueName, long channelId, String filterString, boolean durable) throws Exception
{
Filter filter = filterFactory.createFilter(filterString);
- return createBinding(bindingNodeId,nodeId, condition, queueName, channelId, filter, durable);
+ return createBinding(nodeId, condition, queueName, channelId, filter, durable);
}
- protected Binding createBinding(int bindingNodeId,int nodeId, String condition, String queueName, long channelId, Filter filter, boolean durable)
+ protected Binding createBinding(int nodeId, String condition, String queueName, long channelId, Filter filter, boolean durable)
{
Queue queue;
- if (bindingNodeId == this.nodeId)
+ if (nodeId == this.nodeId)
{
QueuedExecutor executor = (QueuedExecutor)pool.get();
@@ -1478,7 +1458,7 @@
{
BindingInfo info = (BindingInfo)iter.next();
- Binding binding = this.createBinding(info.getNodeId(),info.getNodeId(), info.getCondition(), info.getQueueName(), info.getChannelId(), info.getFilterString(), info.isDurable());
+ Binding binding = this.createBinding(info.getNodeId(), info.getCondition(), info.getQueueName(), info.getChannelId(), info.getFilterString(), info.isDurable());
if (binding.getNodeId() == this.nodeId)
{
More information about the jboss-cvs-commits
mailing list