[jboss-user] [Installation, Configuration & DEPLOYMENT] - Re: ClassLoader leak through TimedCachePolicy.resolutionTime
huuskart
do-not-reply at jboss.com
Wed Mar 5 08:16:15 EST 2008
I tested with this patch to TimedCachePolicy. Yay, undeploy now works!
| --- TimedCachePolicy.java
| +++ TimedCachePolicy.java
| @@ -77,7 +77,17 @@ public class TimedCachePolicy
| public Object getValue();
| }
|
| - protected static Timer resolutionTimer = new Timer(true);
| + protected static Timer resolutionTimer;
| + static {
| + ClassLoader cl = Thread.currentThread().getContextClassLoader();
| + try {
| + Thread.currentThread().setContextClassLoader(
| + TimedCachePolicy.class.getClassLoader());
| + resolutionTimer = new Timer(true);
| + } finally {
| + Thread.currentThread().setContextClassLoader(cl);
| + }
| + }
|
| /** The map of cached TimedEntry objects. */
| protected Map entryMap;
| @@ -223,6 +233,8 @@ public class TimedCachePolicy
| entry = (TimedEntry) value;
| }
| entry.init(now);
| + if (! entry.isCurrent(now))
| + return;
| entryMap.put(key, entry);
| }
| /** Remove the entry associated with key and call destroy on the entry
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4134234#4134234
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4134234
More information about the jboss-user
mailing list