cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r900877 - /cxf/trunk/rt/core/src/main/java/org/apache/cxf/workqueue/AutomaticWorkQueueImpl.java
Date Tue, 19 Jan 2010 18:14:25 GMT
Author: dkulp
Date: Tue Jan 19 18:14:24 2010
New Revision: 900877

URL: http://svn.apache.org/viewvc?rev=900877&view=rev
Log:
Make sure the threadgroup used by the workqueue is destroyed to avoid a
classloader leak.

Modified:
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/workqueue/AutomaticWorkQueueImpl.java

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/workqueue/AutomaticWorkQueueImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/workqueue/AutomaticWorkQueueImpl.java?rev=900877&r1=900876&r2=900877&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/workqueue/AutomaticWorkQueueImpl.java (original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/workqueue/AutomaticWorkQueueImpl.java Tue
Jan 19 18:14:24 2010
@@ -175,6 +175,16 @@
         public void setName(String s) {
             name = s;
         }
+        public void shutdown() {
+            if (!group.isDestroyed()) {
+                try {
+                    group.destroy();
+                    group.setDaemon(true);
+                } catch (Throwable t) {
+                    //ignore
+                }
+            }            
+        }
     }
     
     @Resource(name = "org.apache.cxf.workqueue.WorkQueueManager")
@@ -283,7 +293,14 @@
         if (!processRemainingWorkItems) {
             getQueue().clear();
         }
-        shutdown();    
+        shutdown();
+    }
+    @Override
+    protected void terminated() {
+        ThreadFactory f = this.getThreadFactory();
+        if (f instanceof AWQThreadFactory) {
+            ((AWQThreadFactory)f).shutdown();
+        }
     }
 
     /**



Mime
View raw message