[jboss-cvs] JBoss Messaging SVN: r5515 - in trunk: src/main/org/jboss/messaging/core/server/cluster/impl and 2 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Thu Dec 11 09:04:14 EST 2008
Author: ataylor
Date: 2008-12-11 09:04:14 -0500 (Thu, 11 Dec 2008)
New Revision: 5515
Modified:
trunk/src/main/org/jboss/messaging/core/server/Queue.java
trunk/src/main/org/jboss/messaging/core/server/cluster/impl/ForwarderImpl.java
trunk/src/main/org/jboss/messaging/core/server/impl/QueueImpl.java
trunk/src/main/org/jboss/messaging/core/server/impl/ServerConsumerImpl.java
trunk/tests/src/org/jboss/messaging/tests/unit/core/server/impl/fakes/FakeConsumer.java
Log:
added referenceHandled method to queue.
Modified: trunk/src/main/org/jboss/messaging/core/server/Queue.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/server/Queue.java 2008-12-11 01:25:42 UTC (rev 5514)
+++ trunk/src/main/org/jboss/messaging/core/server/Queue.java 2008-12-11 14:04:14 UTC (rev 5515)
@@ -79,6 +79,8 @@
void referenceAcknowledged(MessageReference ref) throws Exception;
void referenceCancelled();
+
+ void referenceHandled();
int getScheduledCount();
@@ -161,4 +163,5 @@
//Only used in testing
void deliverNow();
+
}
Modified: trunk/src/main/org/jboss/messaging/core/server/cluster/impl/ForwarderImpl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/server/cluster/impl/ForwarderImpl.java 2008-12-11 01:25:42 UTC (rev 5514)
+++ trunk/src/main/org/jboss/messaging/core/server/cluster/impl/ForwarderImpl.java 2008-12-11 14:04:14 UTC (rev 5515)
@@ -234,7 +234,7 @@
{
return HandleStatus.BUSY;
}
-
+ reference.getQueue().referenceHandled();
refs.add(reference);
if (maxBatchTime != -1)
Modified: trunk/src/main/org/jboss/messaging/core/server/impl/QueueImpl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/server/impl/QueueImpl.java 2008-12-11 01:25:42 UTC (rev 5514)
+++ trunk/src/main/org/jboss/messaging/core/server/impl/QueueImpl.java 2008-12-11 14:04:14 UTC (rev 5515)
@@ -355,7 +355,7 @@
return scheduledDeliveryHandler.getScheduledReferences();
}
- public synchronized int getDeliveringCount()
+ public int getDeliveringCount()
{
return deliveringCount.get();
}
@@ -370,6 +370,11 @@
deliveringCount.decrementAndGet();
}
+ public void referenceHandled()
+ {
+ deliveringCount.incrementAndGet();
+ }
+
public int getSizeBytes()
{
return sizeBytes.get();
@@ -873,13 +878,8 @@
{
HandleStatus status = distributionPolicy.distribute(reference);
- if (status == HandleStatus.HANDLED)
+ if (status == HandleStatus.NO_MATCH)
{
- deliveringCount.incrementAndGet();
- return HandleStatus.HANDLED;
- }
- else if (status == HandleStatus.NO_MATCH)
- {
promptDelivery = true;
}
Modified: trunk/src/main/org/jboss/messaging/core/server/impl/ServerConsumerImpl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/server/impl/ServerConsumerImpl.java 2008-12-11 01:25:42 UTC (rev 5514)
+++ trunk/src/main/org/jboss/messaging/core/server/impl/ServerConsumerImpl.java 2008-12-11 14:04:14 UTC (rev 5515)
@@ -532,7 +532,10 @@
{
deliveringRefs.add(ref);
}
-
+ if(!browseOnly)
+ {
+ ref.getQueue().referenceHandled();
+ }
// TODO: get rid of the instanceof by something like message.isLargeMessage()
if (message instanceof ServerLargeMessage)
{
Modified: trunk/tests/src/org/jboss/messaging/tests/unit/core/server/impl/fakes/FakeConsumer.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/unit/core/server/impl/fakes/FakeConsumer.java 2008-12-11 01:25:42 UTC (rev 5514)
+++ trunk/tests/src/org/jboss/messaging/tests/unit/core/server/impl/fakes/FakeConsumer.java 2008-12-11 14:04:14 UTC (rev 5515)
@@ -110,6 +110,7 @@
if (filter.match(reference.getMessage()))
{
references.addLast(reference);
+ reference.getQueue().referenceHandled();
notify();
return HandleStatus.HANDLED;
@@ -136,6 +137,7 @@
if (statusToReturn == HandleStatus.HANDLED)
{
+ reference.getQueue().referenceHandled();
references.addLast(reference);
notify();
}
More information about the jboss-cvs-commits
mailing list