[Jboss-cvs] JBoss Messaging SVN: r1197 - in trunk: . src/main/org/jboss/jms/client/container src/main/org/jboss/jms/client/delegate src/main/org/jboss/jms/client/remoting src/main/org/jboss/jms/server/container src/main/org/jboss/jms/server/endpoint src/main/org/jboss/messaging/core src/main/org/jboss/messaging/core/plugin tests/bin tests/etc

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Aug 4 22:29:33 EDT 2006


Author: ovidiu.feodorov at jboss.com
Date: 2006-08-04 22:29:26 -0400 (Fri, 04 Aug 2006)
New Revision: 1197

Removed:
   trunk/tests/etc/log4j.xml
Modified:
   trunk/messaging.iml
   trunk/src/main/org/jboss/jms/client/container/ProducerAspect.java
   trunk/src/main/org/jboss/jms/client/container/SessionAspect.java
   trunk/src/main/org/jboss/jms/client/delegate/ClientConnectionFactoryDelegate.java
   trunk/src/main/org/jboss/jms/client/remoting/CallbackServerFactory.java
   trunk/src/main/org/jboss/jms/client/remoting/JMSRemotingConnection.java
   trunk/src/main/org/jboss/jms/client/remoting/MessageCallbackHandler.java
   trunk/src/main/org/jboss/jms/server/container/InjectionAspect.java
   trunk/src/main/org/jboss/jms/server/endpoint/ServerConnectionEndpoint.java
   trunk/src/main/org/jboss/jms/server/endpoint/ServerConsumerEndpoint.java
   trunk/src/main/org/jboss/messaging/core/ChannelSupport.java
   trunk/src/main/org/jboss/messaging/core/plugin/SimpleMessageStore.java
   trunk/tests/bin/loop
   trunk/tests/etc/log4j.info.xml
   trunk/tests/etc/log4j.trace.xml
Log:
minor logging and formatting changes

Modified: trunk/messaging.iml
===================================================================
--- trunk/messaging.iml	2006-08-04 20:55:05 UTC (rev 1196)
+++ trunk/messaging.iml	2006-08-05 02:29:26 UTC (rev 1197)
@@ -86,7 +86,9 @@
           <root url="jar://$MODULE_DIR$/lib/jboss-remoting.jar!/" />
         </CLASSES>
         <JAVADOC />
-        <SOURCES />
+        <SOURCES>
+          <root url="file://$MODULE_DIR$/../../cvs/JBossRemoting-2.0.0.Beta2/src/main" />
+        </SOURCES>
       </library>
     </orderEntry>
     <orderEntry type="module-library">
@@ -158,9 +160,22 @@
           <root url="jar://$MODULE_DIR$/thirdparty/oswego-concurrent/lib/concurrent.jar!/" />
         </CLASSES>
         <JAVADOC />
-        <SOURCES />
+        <SOURCES>
+          <root url="file://$MODULE_DIR$/../../concurrent-1.3.4/src" />
+        </SOURCES>
       </library>
     </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://$MODULE_DIR$/thirdparty/jboss/aop/lib/jboss-aop.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES>
+          <root url="file://$MODULE_DIR$/../../jboss-aop_1.5.0.GA/src/aspect-framework/main" />
+        </SOURCES>
+      </library>
+    </orderEntry>
     <orderEntryProperties />
   </component>
 </module>

Modified: trunk/src/main/org/jboss/jms/client/container/ProducerAspect.java
===================================================================
--- trunk/src/main/org/jboss/jms/client/container/ProducerAspect.java	2006-08-04 20:55:05 UTC (rev 1196)
+++ trunk/src/main/org/jboss/jms/client/container/ProducerAspect.java	2006-08-05 02:29:26 UTC (rev 1197)
@@ -232,9 +232,9 @@
       messageToSend.setJMSMessageID(null);
       messageToSend.setMessageId(id);
       
-      //If the message has already been sent we need to make a shallow copy since if we are invm then we do not
-      //want to change the ids of messages already sent - which would happen if we were sending the same
-      //underlying instance
+      // If the message has already been sent we need to make a shallow copy since if we are invm
+      // then we do not want to change the ids of messages already sent - which would happen if we
+      // were sending the same underlying instance.
       if (doCopy)
       {
          messageToSend = messageToSend.doShallowCopy();

Modified: trunk/src/main/org/jboss/jms/client/container/SessionAspect.java
===================================================================
--- trunk/src/main/org/jboss/jms/client/container/SessionAspect.java	2006-08-04 20:55:05 UTC (rev 1196)
+++ trunk/src/main/org/jboss/jms/client/container/SessionAspect.java	2006-08-05 02:29:26 UTC (rev 1197)
@@ -261,11 +261,10 @@
               
          if (handler == null)
          {
-            //This is ok.
+            // This is ok.
+
+            // The original consumer has closed, this message wil get cancelled back to the channel.
             
-            //The original consumer has closed, this message wil get cancelled
-            //back to the channel
-            
             toCancel.addFirst(info);            
          }
          else

Modified: trunk/src/main/org/jboss/jms/client/delegate/ClientConnectionFactoryDelegate.java
===================================================================
--- trunk/src/main/org/jboss/jms/client/delegate/ClientConnectionFactoryDelegate.java	2006-08-04 20:55:05 UTC (rev 1196)
+++ trunk/src/main/org/jboss/jms/client/delegate/ClientConnectionFactoryDelegate.java	2006-08-05 02:29:26 UTC (rev 1197)
@@ -153,7 +153,7 @@
 
       if ("createConnectionDelegate".equals(methodName))
       {
-         //Create a new connection
+         // Create a new connection
          
          remotingConnection = new JMSRemotingConnection(serverLocatorURI, clientPing);
          
@@ -231,7 +231,7 @@
       
       if (remotingConnection != null)
       {
-         //It was a call to createConnectionDelegate - set the remoting connection to use
+         // It was a call to createConnectionDelegate - set the remoting connection to use
          ClientConnectionDelegate connectionDelegate = (ClientConnectionDelegate)ret;
          
          connectionDelegate.setRemotingConnection(remotingConnection);

Modified: trunk/src/main/org/jboss/jms/client/remoting/CallbackServerFactory.java
===================================================================
--- trunk/src/main/org/jboss/jms/client/remoting/CallbackServerFactory.java	2006-08-04 20:55:05 UTC (rev 1196)
+++ trunk/src/main/org/jboss/jms/client/remoting/CallbackServerFactory.java	2006-08-05 02:29:26 UTC (rev 1197)
@@ -207,14 +207,12 @@
    protected void stopCallbackServer(Connector server)
    {
       server.stop();
-      
       server.destroy();
    }
    
    private class Holder
    {
       Connector server;
-      
       int refCount = 1;
    }
   

Modified: trunk/src/main/org/jboss/jms/client/remoting/JMSRemotingConnection.java
===================================================================
--- trunk/src/main/org/jboss/jms/client/remoting/JMSRemotingConnection.java	2006-08-04 20:55:05 UTC (rev 1196)
+++ trunk/src/main/org/jboss/jms/client/remoting/JMSRemotingConnection.java	2006-08-05 02:29:26 UTC (rev 1197)
@@ -79,7 +79,7 @@
 
       if (log.isTraceEnabled()) { log.trace("created client"); }
             
-      //Get the callback server
+      // Get the callback server
       
       callbackServer = CallbackServerFactory.instance.getCallbackServer(serverLocator);
       

Modified: trunk/src/main/org/jboss/jms/client/remoting/MessageCallbackHandler.java
===================================================================
--- trunk/src/main/org/jboss/jms/client/remoting/MessageCallbackHandler.java	2006-08-04 20:55:05 UTC (rev 1196)
+++ trunk/src/main/org/jboss/jms/client/remoting/MessageCallbackHandler.java	2006-08-05 02:29:26 UTC (rev 1197)
@@ -538,7 +538,7 @@
    {
       if (timeout == -1)
       {
-         //receiveNoWait so don't wait
+         // receiveNoWait so don't wait
       }
       else
       {         
@@ -546,7 +546,7 @@
          {         
             if (timeout == 0)
             {
-               //Wait for ever potentially
+               // Wait for ever potentially
                while (!closed && buffer.isEmpty())
                {
                   mainLock.wait();               
@@ -554,7 +554,7 @@
             }
             else
             {
-               //Wait with timeout
+               // Wait with timeout
                long toWait = timeout;
              
                while (!closed && buffer.isEmpty() && toWait > 0)

Modified: trunk/src/main/org/jboss/jms/server/container/InjectionAspect.java
===================================================================
--- trunk/src/main/org/jboss/jms/server/container/InjectionAspect.java	2006-08-04 20:55:05 UTC (rev 1196)
+++ trunk/src/main/org/jboss/jms/server/container/InjectionAspect.java	2006-08-05 02:29:26 UTC (rev 1197)
@@ -55,7 +55,7 @@
     {
        MethodInvocation mi = (MethodInvocation)invocation;
        
-       //First we inject the callback client for the connection
+       // First we inject the callback client for the connection
        
        ServerInvokerCallbackHandler handler =
           (ServerInvokerCallbackHandler)mi.getMetaData(MetaDataConstants.JMS,
@@ -75,7 +75,7 @@
        
        endpoint.setCallbackClient(handler.getCallbackClient());
        
-       //Then we inject the remoting session id of the client
+       // Then we inject the remoting session id of the client
        String sessionId =
           (String)mi.getMetaData(MetaDataConstants.JMS,
                                  MetaDataConstants.REMOTING_SESSION_ID);
@@ -85,7 +85,7 @@
           throw new IllegalStateException("Can't find session id");
        }
        
-       //Then we inject the unique id of the client VM
+       // Then we inject the unique id of the client VM
        String jmsClientVMID =
           (String)mi.getMetaData(MetaDataConstants.JMS,
                                  MetaDataConstants.JMS_CLIENT_VM_ID);
@@ -97,7 +97,7 @@
        
        endpoint.setRemotingInformation(jmsClientVMID, sessionId);       
        
-       //Then we inject the version number from to be used
+       // Then we inject the version number from to be used
        
        Byte ver =
           (Byte)mi.getMetaData(MetaDataConstants.JMS,

Modified: trunk/src/main/org/jboss/jms/server/endpoint/ServerConnectionEndpoint.java
===================================================================
--- trunk/src/main/org/jboss/jms/server/endpoint/ServerConnectionEndpoint.java	2006-08-04 20:55:05 UTC (rev 1196)
+++ trunk/src/main/org/jboss/jms/server/endpoint/ServerConnectionEndpoint.java	2006-08-05 02:29:26 UTC (rev 1197)
@@ -436,7 +436,7 @@
             }
          }      
                  
-         if (trace) { log.trace("request processed ok"); }      
+         if (trace) { log.trace(this + " processed transaction successfully"); }
       }
       catch (Throwable t)
       {
@@ -498,7 +498,7 @@
       callbackClient.setUnMarshaller(new JMSWireFormat());
    }
    
-   //IOC
+   // IOC
    public void setRemotingInformation(String jmsClientVMId, String remotingClientSessionId)
    {
       this.remotingClientSessionId = remotingClientSessionId;

Modified: trunk/src/main/org/jboss/jms/server/endpoint/ServerConsumerEndpoint.java
===================================================================
--- trunk/src/main/org/jboss/jms/server/endpoint/ServerConsumerEndpoint.java	2006-08-04 20:55:05 UTC (rev 1196)
+++ trunk/src/main/org/jboss/jms/server/endpoint/ServerConsumerEndpoint.java	2006-08-05 02:29:26 UTC (rev 1197)
@@ -101,16 +101,16 @@
    
    private List toDeliver;
    
-   //Must be volatile
+   // Must be volatile
    private volatile boolean clientConsumerFull;
    
-   //Must be volatile
+   // Must be volatile
    private volatile boolean bufferFull;
    
-   //No need to be volatile - is protected by lock
+   // No need to be volatile - is protected by lock
    private boolean started;
    
-   //No need to be volatile
+   //No need to be volatile - is protected by lock
    private boolean closed;
    
    //No need to be volatile
@@ -132,40 +132,36 @@
                                     int prefetchSize)
                                     throws InvalidSelectorException
    {
-      if (trace) { log.trace("creating consumer endpoint " + id); }
+      if (trace) { log.trace("constructing consumer endpoint " + id); }
          
       this.id = id;
       this.channel = channel;
       this.sessionEndpoint = sessionEndpoint;
       this.prefetchSize = prefetchSize;
       
-      //We always created with clientConsumerFull = true
-      //This prevents the SCD sending messages to the client before the client has fully
-      //finished creating the MessageCallbackHandler      
+      // We always created with clientConsumerFull = true. This prevents the SCD sending messages to
+      // the client before the client has fully finished creating the MessageCallbackHandler.
       this.clientConsumerFull = true;
             
-      //We allocate an executor for this consumer based on the destination name
-      //so that all consumers for the same destination currently use the same executor
-      //(we can change this if need be)
-      //Note that they do not use the same executor as the channel of the destination
+      // We allocate an executor for this consumer based on the destination name so that all
+      // consumers for the same destination currently use the same executor (we can change this if
+      // need be). Note that they do not use the same executor as the channel of the destination.
       QueuedExecutorPool pool =
          sessionEndpoint.getConnectionEndpoint().getServerPeer().getQueuedExecutorPool();
       
       this.executor = (QueuedExecutor)pool.get("consumer" + dest.getName());
              
-      /*
-      Note that using a PooledExecutor with a linked queue is not sufficient to ensure that
-      deliveries for the same consumer happen serially, since even if they are queued serially
-      the actual deliveries can happen in parallel, resulting in a later one "overtaking" an earlier
-      non-deterministicly depending on thread scheduling.
-      Consequently we use a QueuedExecutor to ensure the deliveries happen sequentially.
-      We do not want each ServerConsumerEndpoint instance to have it's own instance - since
-      we would end up using too many threads, neither do we want to share the same instance
-      amongst all consumers - we do not want to serialize delivery to all consumers.
-      So we maintain a bag of QueuedExecutors and give them out to consumers as required.
-      Different consumers can end up using the same queuedexecutor concurrently if there are a lot
-      of active consumers. 
-      */      
+      // Note that using a PooledExecutor with a linked queue is not sufficient to ensure that
+      // deliveries for the same consumer happen serially, since even if they are queued serially
+      // the actual deliveries can happen in parallel, resulting in a later one "overtaking" an
+      // earlier non-deterministicly depending on thread scheduling.
+      // Consequently we use a QueuedExecutor to ensure the deliveries happen sequentially. We do
+      // not want each ServerConsumerEndpoint instance to have its own instance - since we would
+      // end up using too many threads, neither do we want to share the same instance amongst all
+      // consumers - we do not want to serialize delivery to all consumers. So we maintain a bag of
+      // QueuedExecutors and give them out to consumers as required. Different consumers can end up
+      // using the same queuedexecutor concurrently if there are a lot of active consumers.
+
       this.noLocal = noLocal;
       this.destination = dest;
       
@@ -190,36 +186,38 @@
       //Let's GET RID OF IT!!!!!!!!!!!
       this.deliveries = new LinkedHashMap();
             
-      this.started = this.sessionEndpoint.getConnectionEndpoint().isStarted();      // adding the consumer to the channel
+      this.started = this.sessionEndpoint.getConnectionEndpoint().isStarted();
+
+      // adding the consumer to the channel
       this.channel.add(this);
       
-      //prompt delivery
+      // prompt delivery
       channel.deliver(false);
       
-      log.debug(this + " created");
+      log.debug(this + " constructed");
    }
 
    // Receiver implementation ---------------------------------------
 
    /*
-    * The channel ensures that handle is never called concurrently by more than one thread
+    * The channel ensures that handle is never called concurrently by more than one thread.
     */
    public Delivery handle(DeliveryObserver observer, Routable reference, Transaction tx)
    {
-      if (trace) { log.trace(this + " receives reference " + reference.getMessageID() + " for delivery"); }
+      if (trace) { log.trace(this + " receives reference " + reference + " for delivery"); }
       
-      //This is ok to have outside lock - is volatile
+      // This is ok to have outside lock - is volatile
       if (bufferFull)
       {
-         //We buffer a maximum of PREFETCH_LIMIT messages at once
+         // We buffer a maximum of PREFETCH_LIMIT messages at once
          
          if (trace) { log.trace(this + " has reached prefetch size will not accept any more references"); }
          
          return null;
       }
        
-      //Need to synchronized around the whole block to prevent setting started = false
-      //but handle is already running and a message is deposited during the stop procedure
+      // Need to synchronized around the whole block to prevent setting started = false
+      // but handle is already running and a message is deposited during the stop procedure.
       synchronized (lock)
       {  
          // If the consumer is stopped then we don't accept the message, it should go back into the
@@ -261,7 +259,7 @@
    
          MessageProxy mp = JBossMessage.createThinDelegate(message, ref.getDeliveryCount());
     
-         //Add the proxy to the list to deliver
+         // Add the proxy to the list to deliver
                            
          toDeliver.add(mp);     
           
@@ -572,7 +570,7 @@
    {             
       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;
@@ -586,7 +584,7 @@
          started = true;
       }
       
-      //Prompt delivery
+      // Prompt delivery
       channel.deliver(false);
    }
    
@@ -707,11 +705,11 @@
    {
       public void run()
       {
-         //Is there anything to deliver?
-         //This is ok outside lock - is volatile
+         // Is there anything to deliver?
+         // This is ok outside lock - is volatile
          if (clientConsumerFull)
          {
-            //Do nothing
+            // Do nothing
             return;
          }
          
@@ -740,22 +738,22 @@
             
                ClientDelivery del = new ClientDelivery(list, id);
                
-               //TODO How can we ensure that messages for the same consumer aren't delivered
-               //concurrently to the same consumer on different threads?
+               // TODO How can we ensure that messages for the same consumer aren't delivered
+               // concurrently to the same consumer on different threads?
                MessagingMarshallable mm = new MessagingMarshallable(connection.getUsingVersion(), del);
                
-               MessagingMarshallable resp = (MessagingMarshallable)connection.getCallbackClient().invoke(mm);    
+               MessagingMarshallable resp = (MessagingMarshallable)connection.getCallbackClient().invoke(mm);
+
+               if (trace) { log.trace("handed messages over to the remoting layer"); }
                 
                HandleMessageResponse result = (HandleMessageResponse)resp.getLoad();
-               
-               if (trace) { log.trace("handed messages over to the remoting layer"); }
-               
-               //For now we don't look at how many messages are accepted since they all will be
-               //The field is a placeholder for the future
+
+               // For now we don't look at how many messages are accepted since they all will be.
+               // The field is a placeholder for the future.
                if (result.clientIsFull())
                {
-                  //Stop the server sending any more messages to the client
-                  //This is ok outside lock
+                  // Stop the server sending any more messages to the client.
+                  // This is ok outside lock.
                   clientConsumerFull = true;       
                }                               
             }

Modified: trunk/src/main/org/jboss/messaging/core/ChannelSupport.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/ChannelSupport.java	2006-08-04 20:55:05 UTC (rev 1196)
+++ trunk/src/main/org/jboss/messaging/core/ChannelSupport.java	2006-08-05 02:29:26 UTC (rev 1197)
@@ -46,14 +46,12 @@
 import EDU.oswego.cs.dl.util.concurrent.SynchronizedLong;
 
 /**
- * Channel implementation. It supports atomicity, isolation and recoverability of
- * reliable messages.
- * The channel implementation here uses a "SEDA-type"
- * approach, where requests to handle messages, deliver to receivers or
- * acknowledge messages are not executed concurrently but placed on an event
- * queue and executed serially by a single thread. This prevents lock contention
- * since requests are executed serially, resulting in better scalability and
- * higher throughput at the expense of some latency
+ * Channel implementation. It supports atomicity, isolation and recoverability of reliable messages.
+ * The channel implementation here uses a "SEDA-type" approach, where requests to handle messages,
+ * deliver to receivers or acknowledge messages are not executed concurrently but placed on an event
+ * queue and executed serially by a single thread. This prevents lock contention since requests are
+ * executed serially, resulting in better scalability and higher throughput at the expense of some
+ * latency.
  * 
  * @author <a href="mailto:ovidiu at jboss.org">Ovidiu Feodorov</a>
  * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
@@ -210,12 +208,10 @@
 
       try
       {
-         // Instead of executing directly, we add the handle request to the
-         // event queue
-         // Since remoting doesn't currently handle non blocking IO, we still
-         // have to wait for the result
-         // But when remoting does, we can use a full SEDA approach and get even
-         // better throughput
+         // Instead of executing directly, we add the handle request to the event queue.
+         // Since remoting doesn't currently handle non blocking IO, we still have to wait for the
+         // result, but when remoting does, we can use a full SEDA approach and get even better
+         // throughput.
          this.executor.execute(new HandleRunnable(result, sender, r, tx));
       }
       catch (InterruptedException e)
@@ -223,7 +219,7 @@
          log.warn("Thread interrupted", e);
       }
 
-      return (Delivery) result.getResult();
+      return (Delivery)result.getResult();
    }
 
    // DeliveryObserver implementation --------------------------
@@ -265,10 +261,7 @@
       {
          this.getCallback(tx).addDelivery(d);
 
-         if (trace)
-         {
-            log.trace(this + " added " + d + " to memory on transaction "
-                     + tx);
+         if (trace) { log.trace(this + " added " + d + " to memory on transaction " + tx);
          }
 
          if (recoverable && d.getReference().isReliable())
@@ -303,20 +296,13 @@
 
    public boolean add(Receiver r)
    {
-      if (trace)
-      {
-         log.trace(this + " attempting to add receiver " + r);
-      }
+      if (trace) { log.trace(this + " attempting to add receiver " + r); }
 
       boolean added = router.add(r);
 
-      if (trace)
-      {
-         log.trace("receiver " + r + (added ? "" : " NOT") + " added");
-      }
+      if (trace) { log.trace("receiver " + r + (added ? "" : " NOT") + " added"); }
       
       receiversReady = true;
-
       return added;
    }
 
@@ -324,10 +310,7 @@
    {
       boolean removed = router.remove(r);
 
-      if (trace)
-      {
-         log.trace(this + (removed ? " removed " : " did NOT remove ") + r);
-      }
+      if (trace) { log.trace(this + (removed ? " removed " : " did NOT remove ") + r); }
 
       return removed;
    }
@@ -422,7 +405,7 @@
          
          if (synchronous)
          {
-            //Wait to complete
+            // Wait to complete
             future.getResult();
          }
       }
@@ -645,8 +628,8 @@
    {
       try
       {
-         //The iterator is used to iterate through the refs in the channel in the case
-         //That they don't match the selectors of any receivers
+         // The iterator is used to iterate through the refs in the channel in the case that they
+         // don't match the selectors of any receivers.
          ListIterator iter = null;
          
          MessageReference ref = null;
@@ -803,22 +786,14 @@
       }
    }
 
-   protected Delivery handleInternal(DeliveryObserver sender, Routable r,
-            Transaction tx)
+   protected Delivery handleInternal(DeliveryObserver sender, Routable r, Transaction tx)
    {
       if (r == null)
       {
          return null;
       }
 
-      if (trace)
-      {
-         log.trace(this
-                  + " handles "
-                  + r
-                  + (tx == null ? " non-transactionally" : " in transaction: "
-                           + tx));
-      }
+      if (trace) { log.trace(this + " handles " + r + (tx == null ? " non-transactionally" : " in transaction: " + tx)); }
 
       MessageReference ref = obtainReference(r);
 
@@ -859,20 +834,15 @@
             if (ref.isReliable() && recoverable)
             {
                // Reliable message in a recoverable state - also add to db
-               if (trace)
-               {
-                  log.trace("adding " + ref
-                           + " to database non-transactionally");
-               }
+               if (trace) { log.trace(this + "adding " + ref + " to database non-transactionally"); }
 
                pm.addReference(channelID, ref, null);               
             }
             
             addReferenceInMemory(ref);
 
-            // We only do delivery if there are receivers that haven't said they
-            // don't want
-            // any more references
+            // We only do delivery if there are receivers that haven't said they don't want
+            // any more references.
             if (receiversReady)
             {
                // Prompt delivery
@@ -881,14 +851,7 @@
          }
          else
          {
-            if (trace)
-            {
-               log.trace("adding "
-                        + ref
-                        + " to state "
-                        + (tx == null ? "non-transactionally"
-                                 : "in transaction: " + tx));
-            }
+            if (trace) { log.trace(this + "adding " + ref + " to state " + (tx == null ? "non-transactionally" : "in transaction: " + tx)); }
 
             checkMemory();
 
@@ -919,13 +882,7 @@
             if (ref.isReliable() && recoverable)
             {
                // Reliable message in a recoverable state - also add to db
-               if (trace)
-               {
-                  log.trace("adding "
-                           + ref
-                           + (tx == null ? " to database non-transactionally"
-                                    : " in transaction: " + tx));
-               }
+               if (trace) { log.trace(this + "adding " + ref + (tx == null ? " to database non-transactionally" : " in transaction: " + tx)); }
 
                pm.addReference(channelID, ref, tx);
             }
@@ -1063,7 +1020,7 @@
          }
          else
          {
-            // Each channel has it's own copy of the reference
+            // Each channel has its own copy of the reference
             ref = ((MessageReference) r).copy();
          }
 
@@ -1582,6 +1539,12 @@
          executeAndWaitForResult();
       }
 
+      public String toString()
+      {
+         return ChannelSupport.this + ".InMemoryCallback[" +
+                Integer.toHexString(InMemoryCallback.this.hashCode()) + "]";
+      }
+
       private void executeAndWaitForResult() throws TransactionException
       {
          result = new Future();
@@ -1627,11 +1590,7 @@
          {
             MessageReference ref = (MessageReference) iter.next();
 
-            if (trace)
-            {
-               log.trace(this + ": adding " + ref
-                                 + " to non-recoverable state");
-            }
+            if (trace) { log.trace(this + ": adding " + ref + " to non-recoverable state"); }
 
             try
             {
@@ -1684,6 +1643,7 @@
             ref.releaseMemoryReference();
          }
       }
+
    }
 
    /**
@@ -1770,8 +1730,7 @@
 
       Transaction tx;
 
-      HandleRunnable(Future result, DeliveryObserver sender, Routable routable,
-               Transaction tx)
+      HandleRunnable(Future result, DeliveryObserver sender, Routable routable, Transaction tx)
       {
          this.result = result;
          this.sender = sender;
@@ -1782,7 +1741,6 @@
       public void run()
       {
          Delivery d = handleInternal(sender, routable, tx);
-
          result.setResult(d);
       }
    }

Modified: trunk/src/main/org/jboss/messaging/core/plugin/SimpleMessageStore.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/plugin/SimpleMessageStore.java	2006-08-04 20:55:05 UTC (rev 1196)
+++ trunk/src/main/org/jboss/messaging/core/plugin/SimpleMessageStore.java	2006-08-05 02:29:26 UTC (rev 1197)
@@ -122,10 +122,10 @@
       return acceptReliableMessages;
    }
 
-   //TODO If we can assume that the message is not known to the store before
-   //(true when sending messages)
-   //Then we can avoid synchronizing on this and use a ConcurrentHashmap
-   //Which will give us much better concurrency for many threads
+   // TODO If we can assume that the message is not known to the store before
+   // (true when sending messages)
+   // Then we can avoid synchronizing on this and use a ConcurrentHashmap
+   // Which will give us much better concurrency for many threads
    public MessageReference reference(Message m)
    {
       if (m.isReliable() && !acceptReliableMessages)

Modified: trunk/tests/bin/loop
===================================================================
--- trunk/tests/bin/loop	2006-08-04 20:55:05 UTC (rev 1196)
+++ trunk/tests/bin/loop	2006-08-05 02:29:26 UTC (rev 1197)
@@ -12,7 +12,7 @@
    echo "#                                           #"
    echo "#############################################"
    echo ""
-   #cat /dev/null ../output/logs/messaging-tests.trace.log
+   cat /dev/null > ../output/logs/messaging-tests.trace.log
    if ! ./runtest; then
 		echo "Test failed on loop $i"
       exit 1

Modified: trunk/tests/etc/log4j.info.xml
===================================================================
--- trunk/tests/etc/log4j.info.xml	2006-08-04 20:55:05 UTC (rev 1196)
+++ trunk/tests/etc/log4j.info.xml	2006-08-05 02:29:26 UTC (rev 1197)
@@ -19,8 +19,7 @@
       <param name="Append" value="true"/>
 
       <layout class="org.apache.log4j.PatternLayout">
-         <param name="ConversionPattern" value="%d %-5r %-5p [%c] (%t:%x) %m%n"/>
-
+         <param name="ConversionPattern" value="%d %-5r %-5p [%c] @%t %m%n"/>
       </layout>
    </appender>
 

Modified: trunk/tests/etc/log4j.trace.xml
===================================================================
--- trunk/tests/etc/log4j.trace.xml	2006-08-04 20:55:05 UTC (rev 1196)
+++ trunk/tests/etc/log4j.trace.xml	2006-08-05 02:29:26 UTC (rev 1197)
@@ -19,8 +19,7 @@
       <param name="Append" value="true"/>
 
       <layout class="org.apache.log4j.PatternLayout">
-         <param name="ConversionPattern" value="%d %-5r %-5p [%c] (%t:%x) %m%n"/>
-
+         <param name="ConversionPattern" value="%d %-5r %-5p [%c] @%t %m%n"/>
       </layout>
    </appender>
 
@@ -57,6 +56,16 @@
       <priority value="TRACE" class="org.jboss.logging.XLevel"/>
    </category>
 
+   <!-- Ignoring trace from these: -->
+
+   <category name="org.jboss.jms.server.remoting.JMSServerInvocationHandler">
+      <priority value="DEBUG"/>
+   </category>
+
+   <category name="org.jboss.test.messaging.tools.jmx.MockJBossSecurityManager">
+      <priority value="DEBUG"/>
+   </category>
+
    <root>
       <appender-ref ref="CONSOLE"/>
       <appender-ref ref="FILE"/>

Deleted: trunk/tests/etc/log4j.xml
===================================================================
--- trunk/tests/etc/log4j.xml	2006-08-04 20:55:05 UTC (rev 1196)
+++ trunk/tests/etc/log4j.xml	2006-08-05 02:29:26 UTC (rev 1197)
@@ -1,65 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
-
-<!-- $Id$ -->
-
-<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
-
-   <appender name="FILE" class="org.jboss.logging.appender.DailyRollingFileAppender">
-
-      <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
-      <param name="File" value="${module.output}/logs/messaging-tests${remote.test.suffix}.trace.log"/>
-      <param name="DatePattern" value="'.'yyyy-MM-dd"/>
-      <param name="Threshold" value="TRACE#org.jboss.logging.XLevel"/>
-
-      <!-- since majority of the tests are ran in fork mode by ant, the log file is overwritten
-           for each test. We need to append if we want to preserve a full testsuite run log.
-           Make sure the build script clears this log at the beginning of each run.
-      -->
-      <param name="Append" value="true"/>
-
-      <layout class="org.apache.log4j.PatternLayout">
-         <param name="ConversionPattern" value="%d %-5r %-5p [%c] (%t:%x) %m%n"/>
-
-      </layout>
-   </appender>
-
-   <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
-      <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
-      <param name="Target" value="System.out"/>
-      <param name="Threshold" value="INFO"/>
-      <layout class="org.apache.log4j.PatternLayout">
-         <param name="ConversionPattern" value="%t %d{ABSOLUTE} %-5p [%c{1}] %m%n"/>
-      </layout>
-   </appender>
-
-   <category name="org.apache">
-      <priority value="INFO"/>
-   </category>
-
-   <category name="org.jgroups">
-      <priority value="WARN"/>
-   </category>
-
-   <category name="org.jboss">
-      <priority value="INFO"/>
-   </category>
-
-   <category name="org.jboss.messaging">
-      <priority value="TRACE" class="org.jboss.logging.XLevel"/>
-   </category>
-
-   <category name="org.jboss.jms">
-      <priority value="TRACE" class="org.jboss.logging.XLevel"/>
-   </category>
-
-   <category name="org.jboss.test">
-      <priority value="TRACE" class="org.jboss.logging.XLevel"/>
-   </category>
-
-   <root>
-      <appender-ref ref="CONSOLE"/>
-      <appender-ref ref="FILE"/>
-   </root>
-
-</log4j:configuration>




More information about the jboss-cvs-commits mailing list