james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nor...@apache.org
Subject svn commit: r1055812 - /james/server/trunk/mailets/src/main/java/org/apache/james/transport/mailets/RemoteDelivery.java
Date Thu, 06 Jan 2011 10:03:47 GMT
Author: norman
Date: Thu Jan  6 10:03:47 2011
New Revision: 1055812

URL: http://svn.apache.org/viewvc?rev=1055812&view=rev
Log:
Make sure the delivery threads are started after all the other configs params are processed.
See JAMES-1175

Modified:
    james/server/trunk/mailets/src/main/java/org/apache/james/transport/mailets/RemoteDelivery.java

Modified: james/server/trunk/mailets/src/main/java/org/apache/james/transport/mailets/RemoteDelivery.java
URL: http://svn.apache.org/viewvc/james/server/trunk/mailets/src/main/java/org/apache/james/transport/mailets/RemoteDelivery.java?rev=1055812&r1=1055811&r2=1055812&view=diff
==============================================================================
--- james/server/trunk/mailets/src/main/java/org/apache/james/transport/mailets/RemoteDelivery.java
(original)
+++ james/server/trunk/mailets/src/main/java/org/apache/james/transport/mailets/RemoteDelivery.java
Thu Jan  6 10:03:47 2011
@@ -306,14 +306,7 @@ public class RemoteDelivery extends Gene
         }
         queue = queueFactory.getQueue(outgoing);
         
-        // Start Workers Threads.
-        workersThreadCount = Integer.parseInt(getInitParameter("deliveryThreads"));
-        for (int i = 0; i < workersThreadCount; i++) {
-            String threadName = "Remote delivery thread (" + i + ")";
-            Thread t = new Thread(this, threadName);
-            t.start();
-            workersThreads.add(t);
-        }
+
 
         try {
             if (getInitParameter("timeout") != null) {
@@ -388,8 +381,19 @@ public class RemoteDelivery extends Gene
         
         heloName = getInitParameter("heloName");
 
+        // Start Workers Threads.
+        workersThreadCount = Integer.parseInt(getInitParameter("deliveryThreads"));
+        initDeliveryThreads();
     }
 
+    private void initDeliveryThreads() {
+        for (int a = 0; a < workersThreadCount; a++) {
+            String threadName = "Remote delivery thread (" + a + ")";
+            Thread t = new Thread(this, threadName);
+            t.start();
+            workersThreads.add(t);
+        }
+    }
     /**
      * Calculates Total no. of attempts for the specified delayList.
      * 
@@ -714,6 +718,7 @@ public class RemoteDelivery extends Gene
                     Mail mail = queueItem.getMail();
                     
                     String key = mail.getName();
+                    
                     try {
                         if (isDebug) {
                             String message = Thread.currentThread().getName()



---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message