portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rwat...@apache.org
Subject svn commit: r938715 - in /portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/aggregator/impl: CommonjWorkerMonitorImpl.java WorkerMonitorImpl.java
Date Tue, 27 Apr 2010 23:03:02 GMT
Author: rwatler
Date: Tue Apr 27 23:03:01 2010
New Revision: 938715

URL: http://svn.apache.org/viewvc?rev=938715&view=rev
Log:
JS2-1183: cleanup shutdown of aggregation monitor and worker threads

Modified:
    portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/aggregator/impl/CommonjWorkerMonitorImpl.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/aggregator/impl/WorkerMonitorImpl.java

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/aggregator/impl/CommonjWorkerMonitorImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/aggregator/impl/CommonjWorkerMonitorImpl.java?rev=938715&r1=938714&r2=938715&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/aggregator/impl/CommonjWorkerMonitorImpl.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/aggregator/impl/CommonjWorkerMonitorImpl.java
Tue Apr 27 23:03:01 2010
@@ -403,6 +403,7 @@ public class CommonjWorkerMonitorImpl im
         CommonjWorkerRenderingJobTimeoutMonitor(long interval) 
         {
             super("CommonjWorkerRenderingJobTimeoutMonitor");
+            setDaemon(true);
 
             if (interval > 0) 
             {

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/aggregator/impl/WorkerMonitorImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/aggregator/impl/WorkerMonitorImpl.java?rev=938715&r1=938714&r2=938715&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/aggregator/impl/WorkerMonitorImpl.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/aggregator/impl/WorkerMonitorImpl.java
Tue Apr 27 23:03:01 2010
@@ -20,7 +20,6 @@ package org.apache.jetspeed.aggregator.i
 import java.security.AccessControlContext;
 import java.security.AccessController;
 import java.util.ArrayList;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Stack;
 import java.util.LinkedList;
@@ -106,15 +105,21 @@ public class WorkerMonitorImpl implement
     }
 
     public void stop()
-    {    
-    	for (WorkerImpl worker : workers)
-    	{
-    		worker.interrupt();
-    	}
-    	for (WorkerImpl worker : workersMonitored)
-    	{
-    		worker.interrupt();
-    	}
+    {
+        synchronized (workers)
+        {        
+            for (WorkerImpl worker : new ArrayList<WorkerImpl>(workers))
+            {
+                worker.interrupt();
+            }
+        }
+        synchronized (workersMonitored)
+        {        
+            for (WorkerImpl worker : new ArrayList<WorkerImpl>(workersMonitored))
+            {
+                worker.interrupt();
+            }
+        }
     	if (jobMonitor != null)
     	{
     		jobMonitor.endThread();
@@ -319,6 +324,7 @@ public class WorkerMonitorImpl implement
         RenderingJobTimeoutMonitor(long interval)
         {
             super("RenderingJobTimeoutMonitor");
+            setDaemon(true);
 
             if (interval > 0)
             {
@@ -385,10 +391,9 @@ public class WorkerMonitorImpl implement
                     {
                         wait(this.interval);
                     }
-                } 
+                }   
                 catch (InterruptedException e) 
-                {
-                    ;
+                {   
                 }
             }
         }



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


Mime
View raw message