Author: dkulp
Date: Tue Jan 19 18:22:30 2010
New Revision: 900886
URL: http://svn.apache.org/viewvc?rev=900886&view=rev
Log:
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.2.x-fixes/ (props changed)
cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/workqueue/AutomaticWorkQueueImpl.java
Propchange: cxf/branches/2.2.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.
Modified:
cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/workqueue/AutomaticWorkQueueImpl.java
URL:
http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/workqueue/AutomaticWorkQueueImpl.java?rev=900886&r1=900885&r2=900886&view=diff
==============================================================================
---
cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/workqueue/AutomaticWorkQueueImpl.java
(original)
+++
cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/workqueue/AutomaticWorkQueueImpl.java
Tue Jan 19 18:22:30 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();
+ }
}
/**