[jboss-cvs] JBoss Messaging SVN: r2030 - in trunk/src/main/org/jboss: jms/server/endpoint and 1 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Jan 23 22:29:10 EST 2007
Author: ovidiu.feodorov at jboss.com
Date: 2007-01-23 22:29:10 -0500 (Tue, 23 Jan 2007)
New Revision: 2030
Modified:
trunk/src/main/org/jboss/jms/client/remoting/MessageCallbackHandler.java
trunk/src/main/org/jboss/jms/server/endpoint/ServerConsumerEndpoint.java
trunk/src/main/org/jboss/jms/server/endpoint/ServerSessionEndpoint.java
trunk/src/main/org/jboss/messaging/core/ChannelSupport.java
Log:
Extra logging while investigating http://jira.jboss.com/jira/browse/JBMESSAGING-775
Modified: trunk/src/main/org/jboss/jms/client/remoting/MessageCallbackHandler.java
===================================================================
--- trunk/src/main/org/jboss/jms/client/remoting/MessageCallbackHandler.java 2007-01-24 02:35:46 UTC (rev 2029)
+++ trunk/src/main/org/jboss/jms/client/remoting/MessageCallbackHandler.java 2007-01-24 03:29:10 UTC (rev 2030)
@@ -83,11 +83,11 @@
{
if (expired)
{
- log.trace("Message " + proxy.getMessage() + " has expired - cancelling to server");
+ log.trace(proxy.getMessage() + " has expired, cancelling to server");
}
else
{
- log.trace("Message " + proxy.getMessage() + " has reached max deliveries - cancelling to server");
+ log.trace(proxy.getMessage() + " has reached maximum delivery number, cancelling to server");
}
}
final Cancel cancel = new DefaultCancel(proxy.getDeliveryId(), proxy.getDeliveryCount(),
@@ -245,7 +245,7 @@
{
MessageProxy msg = (MessageProxy) message;
- if (trace) { log.trace("Receiving message " + msg + " from the remoting layer"); }
+ if (trace) { log.trace(this + " receiving message " + msg + " from the remoting layer"); }
synchronized (mainLock)
{
Modified: trunk/src/main/org/jboss/jms/server/endpoint/ServerConsumerEndpoint.java
===================================================================
--- trunk/src/main/org/jboss/jms/server/endpoint/ServerConsumerEndpoint.java 2007-01-24 02:35:46 UTC (rev 2029)
+++ trunk/src/main/org/jboss/jms/server/endpoint/ServerConsumerEndpoint.java 2007-01-24 03:29:10 UTC (rev 2030)
@@ -53,11 +53,9 @@
/**
* Concrete implementation of ConsumerEndpoint.
*
- * Lives on the boundary between Messaging Core and the
- * JMS Facade.
+ * Lives on the boundary between Messaging Core and the JMS Facade. Handles delivery of messages
+ * from the server to the client side consumer.
*
- * Handles delivery of messages from the server to the client side consumer.
- *
*
* @author <a href="mailto:ovidiu at jboss.org">Ovidiu Feodorov</a>
* @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
@@ -67,13 +65,13 @@
*/
public class ServerConsumerEndpoint implements Receiver, ConsumerEndpoint
{
- // Constants -----------------------------------------------------
+ // Constants ------------------------------------------------------------------------------------
private static final Logger log = Logger.getLogger(ServerConsumerEndpoint.class);
- // Static --------------------------------------------------------
+ // Static ---------------------------------------------------------------------------------------
- // Attributes ----------------------------------------------------
+ // Attributes -----------------------------------------------------------------------------------
private boolean trace = log.isTraceEnabled();
@@ -109,7 +107,7 @@
// Must be volatile
private volatile boolean clientAccepting;
- // Constructors --------------------------------------------------
+ // Constructors ---------------------------------------------------------------------------------
ServerConsumerEndpoint(int id, Channel messageQueue, String queueName,
ServerSessionEndpoint sessionEndpoint,
@@ -164,7 +162,7 @@
log.debug(this + " constructed");
}
- // Receiver implementation ---------------------------------------
+ // Receiver implementation ----------------------------------------------------------------------
/*
* The queue ensures that handle is never called concurrently by more than one thread.
@@ -205,7 +203,7 @@
return null;
}
- if (trace) { log.trace(this + " has the main lock, preparing the message for delivery"); }
+ if (trace) { log.trace(this + " has startStopLock lock, preparing the message for delivery"); }
JBossMessage message = (JBossMessage)ref.getMessage();
@@ -260,7 +258,7 @@
- // Filter implementation -----------------------------------------
+ // Filter implementation ------------------------------------------------------------------------
public boolean accept(Routable r)
{
@@ -295,7 +293,7 @@
}
- // Closeable implementation --------------------------------------
+ // Closeable implementation ---------------------------------------------------------------------
public void closing() throws JMSException
{
@@ -327,7 +325,7 @@
}
}
- // ConsumerEndpoint implementation -------------------------------
+ // ConsumerEndpoint implementation --------------------------------------------------------------
public void changeRate(float newRate) throws JMSException
@@ -392,7 +390,7 @@
throw new IllegalStateException("isClosed should never be handled on the server side");
}
- // Public --------------------------------------------------------
+ // Public ---------------------------------------------------------------------------------------
public String toString()
{
@@ -409,7 +407,7 @@
return sessionEndpoint;
}
- // Package protected ---------------------------------------------
+ // Package protected ----------------------------------------------------------------------------
Queue getDLQ()
{
@@ -524,15 +522,15 @@
}
}
- // Protected -----------------------------------------------------
+ // Protected ------------------------------------------------------------------------------------
- // Private -------------------------------------------------------
+ // Private --------------------------------------------------------------------------------------
private void promptDelivery()
{
messageQueue.deliver(Channel.ASYNCRHONOUS);
}
- // Inner classes -------------------------------------------------
+ // Inner classes --------------------------------------------------------------------------------
}
Modified: trunk/src/main/org/jboss/jms/server/endpoint/ServerSessionEndpoint.java
===================================================================
--- trunk/src/main/org/jboss/jms/server/endpoint/ServerSessionEndpoint.java 2007-01-24 02:35:46 UTC (rev 2029)
+++ trunk/src/main/org/jboss/jms/server/endpoint/ServerSessionEndpoint.java 2007-01-24 03:29:10 UTC (rev 2030)
@@ -1075,8 +1075,7 @@
if (queue != null)
{
queue.handle(null, ref, tx);
-
- del.acknowledge(tx);
+ del.acknowledge(tx);
}
else
{
@@ -1091,7 +1090,6 @@
catch (Throwable t)
{
tx.rollback();
-
throw t;
}
finally
Modified: trunk/src/main/org/jboss/messaging/core/ChannelSupport.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/ChannelSupport.java 2007-01-24 02:35:46 UTC (rev 2029)
+++ trunk/src/main/org/jboss/messaging/core/ChannelSupport.java 2007-01-24 03:29:10 UTC (rev 2030)
@@ -602,15 +602,16 @@
if (trace) { log.trace(this + " added " + ref + " back into state"); }
}
- /*
- * This methods delivers as many messages as possible to the router until no
- * more deliveries are returned. This method should never be called at the
- * same time as handle.
+ /**
+ * This methods delivers as many messages as possible to the router until no more deliveries are
+ * returned. This method should never be called at the same time as handle.
*
* @see org.jboss.messaging.core.Channel#deliver()
*/
protected void deliverInternal()
{
+ if (trace) { log.trace(this + " was prompted delivery"); }
+
try
{
// The iterator is used to iterate through the refs in the channel in the case that they
@@ -1066,6 +1067,7 @@
}
catch (Throwable t)
{
+ log.debug(this + "'s execution generated exception", t);
result.setException(t);
}
}
@@ -1086,11 +1088,9 @@
}
else
{
- // We don't execute the commit directly, we add it to the event queue
- // of the channel
+ // We don't execute the commit directly, we add it to the event queue of the channel
// so it is executed in turn
committing = true;
-
executeAndWaitForResult();
}
}
@@ -1124,6 +1124,7 @@
try
{
+ if (trace) { log.trace("adding " + this + " to " + ChannelSupport.this + "'s executor"); }
executor.execute(this);
}
catch (InterruptedException e)
@@ -1133,7 +1134,9 @@
// Wait for it to complete
- Throwable t = (Throwable) result.getResult();
+ if (trace) { log.trace("waiting for " + this + " to complete"); }
+ Throwable t = (Throwable)result.getResult();
+ if (trace) { log.trace(InMemoryCallback.this + " completed"); }
if (t != null)
{
@@ -1157,11 +1160,9 @@
{
// We add the references to the state
- Iterator iter = refsToAdd.iterator();
-
- while (iter.hasNext())
+ for(Iterator i = refsToAdd.iterator(); i.hasNext(); )
{
- MessageReference ref = (MessageReference) iter.next();
+ MessageReference ref = (MessageReference)i.next();
if (trace) { log.trace(this + ": adding " + ref + " to non-recoverable state"); }
@@ -1180,11 +1181,9 @@
// Remove deliveries
- iter = this.deliveriesToRemove.iterator();
-
- while (iter.hasNext())
+ for(Iterator i = deliveriesToRemove.iterator(); i.hasNext(); )
{
- Delivery del = (Delivery) iter.next();
+ Delivery del = (Delivery)i.next();
if (trace) { log.trace(this + " removing " + del + " after commit"); }
@@ -1193,7 +1192,7 @@
deliveringCount.decrement();
}
- //prompt delivery
+ // prompt delivery
if (receiversReady)
{
deliverInternal();
@@ -1202,21 +1201,18 @@
private void doAfterRollback()
{
- Iterator iter = refsToAdd.iterator();
-
- while (iter.hasNext())
+ for(Iterator i = refsToAdd.iterator(); i.hasNext(); )
{
- MessageReference ref = (MessageReference) iter.next();
+ MessageReference ref = (MessageReference)i.next();
+ if (trace) { log.trace(this + " releasing memory " + ref + " after rollback"); }
ref.releaseMemoryReference();
}
}
-
}
/**
- * Give subclass a chance to process the message before storing it
- * internally.
+ * Give subclass a chance to process the message before storing it internally.
* TODO - Do we really need this?
*/
protected void processMessageBeforeStorage(MessageReference reference)
More information about the jboss-cvs-commits
mailing list