[jboss-cvs] JBoss Messaging SVN: r1393 - trunk/src/main/org/jboss/jms/server/endpoint
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Fri Sep 29 00:44:49 EDT 2006
Author: ovidiu.feodorov at jboss.com
Date: 2006-09-29 00:44:48 -0400 (Fri, 29 Sep 2006)
New Revision: 1393
Modified:
trunk/src/main/org/jboss/jms/server/endpoint/ServerConsumerEndpoint.java
Log:
minor reformatting
Modified: trunk/src/main/org/jboss/jms/server/endpoint/ServerConsumerEndpoint.java
===================================================================
--- trunk/src/main/org/jboss/jms/server/endpoint/ServerConsumerEndpoint.java 2006-09-29 03:43:08 UTC (rev 1392)
+++ trunk/src/main/org/jboss/jms/server/endpoint/ServerConsumerEndpoint.java 2006-09-29 04:44:48 UTC (rev 1393)
@@ -614,16 +614,16 @@
protected void stop() throws Throwable
{
- //We need to:
- //Stop accepting any new messages in the SCE
- //Flush any messages from the SCE to the buffer
- //If the client consumer is now full, then we need to cancel the ones in the toDeliver list
+ // We need to:
+ // - Stop accepting any new messages in the SCE.
+ // - Flush any messages from the SCE to the buffer.
+ // If the client consumer is now full, then we need to cancel the ones in the toDeliver list.
- //We need to lock since otherwise we could set started to false but the handle method was already executing
- //and messages might get deposited after
+ // We need to lock since otherwise we could set started to false but the handle method was
+ // already executing and messages might get deposited after.
synchronized (lock)
{
- //can't start or stop it if it is closed
+ // can't start or stop it if it is closed
if (closed)
{
return;
@@ -632,31 +632,28 @@
started = false;
}
- //Now we know no more messages will be accepted in the SCE
+ // Now we know no more messages will be accepted in the SCE.
try
{
- //Flush any messages waiting to be sent to the client
+ // Flush any messages waiting to be sent to the client.
this.executor.execute(new Deliverer());
- //Now wait for it to execute
+ // Now wait for it to execute.
Future result = new Future();
-
this.executor.execute(new Waiter(result));
-
result.getResult();
- //Now we know any deliverer has delivered any outstanding messages to the client buffer
+ // Now we know any deliverer has delivered any outstanding messages to the client buffer.
}
catch (InterruptedException e)
{
log.warn("Thread interrupted", e);
}
- //Now we know that there are no in flight messages on the way to the client consumer.
-
- //But there may be messages still in the toDeliver list since the client consumer might be full
- //So we need to cancel these
+ // Now we know that there are no in flight messages on the way to the client consumer, but
+ // there may be messages still in the toDeliver list since the client consumer might be full,
+ // so we need to cancel these.
if (!toDeliver.isEmpty())
{
@@ -665,15 +662,12 @@
for (int i = toDeliver.size() - 1; i >= 0; i--)
{
MessageProxy proxy = (MessageProxy)toDeliver.get(i);
-
long id = proxy.getMessage().getMessageID();
-
cancelDelivery(new Long(id));
}
}
toDeliver.clear();
-
bufferFull = false;
}
}
More information about the jboss-cvs-commits
mailing list