Author: dkulp Date: Tue Jan 19 18:45:45 2010 New Revision: 900898 URL: http://svn.apache.org/viewvc?rev=900898&view=rev Log: Merged revisions 900886 via svnmerge from https://svn.apache.org/repos/asf/cxf/branches/2.2.x-fixes
................ r900886 | dkulp | 2010-01-19 13:22:30 -0500 (Tue, 19 Jan 2010) | 10 lines Merged revisions 900877 via svnmerge from https://svn.apache.org/repos/asf/cxf/trunk ........ r900877 | dkulp | 2010-01-19 13:14:24 -0500 (Tue, 19 Jan 2010) | 2 lines Make sure the threadgroup used by the workqueue is destroyed to avoid a classloader leak. ........ ................ Modified: cxf/branches/2.1.x-fixes/ (props changed) cxf/branches/2.1.x-fixes/rt/core/src/main/java/org/apache/cxf/workqueue/AutomaticWorkQueueImpl.java Propchange: cxf/branches/2.1.x-fixes/ ------------------------------------------------------------------------------ Binary property 'svnmerge-integrated' - no diff available. Modified: cxf/branches/2.1.x-fixes/rt/core/src/main/java/org/apache/cxf/workqueue/AutomaticWorkQueueImpl.java URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/rt/core/src/main/java/org/apache/cxf/workqueue/AutomaticWorkQueueImpl.java?rev=900898&r1=900897&r2=900898&view=diff ============================================================================== --- cxf/branches/2.1.x-fixes/rt/core/src/main/java/org/apache/cxf/workqueue/AutomaticWorkQueueImpl.java (original) +++ cxf/branches/2.1.x-fixes/rt/core/src/main/java/org/apache/cxf/workqueue/AutomaticWorkQueueImpl.java Tue Jan 19 18:45:45 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(); + } } /**
