diff options
author | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2009-07-23 20:48:44 +0000 |
---|---|---|
committer | slaws <slaws@13f79535-47bb-0310-9956-ffa450edef68> | 2009-07-23 20:48:44 +0000 |
commit | ff20788f3f393d46a942cba0e3168bf9294f6cab (patch) | |
tree | 234bb2f8dbe88827eda5326a96802845b6508ae9 /branches/sca-java-1.x/modules/core/src | |
parent | 3c764a6565b76c491e7f14515a8418b9bffed75a (diff) |
TUSCANY-3173 remove the contents of thread local storage when the webapp shuts down. If you don't remove it the thread local storage will hold an object which, via its class, points to the WebAppClassloader. With a container with pooled threads this pins the classloader so it can't be GCd
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@797219 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'branches/sca-java-1.x/modules/core/src')
-rw-r--r-- | branches/sca-java-1.x/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/ThreadMessageContext.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/branches/sca-java-1.x/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/ThreadMessageContext.java b/branches/sca-java-1.x/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/ThreadMessageContext.java index 504bd9b036..dd3a4f9ac3 100644 --- a/branches/sca-java-1.x/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/ThreadMessageContext.java +++ b/branches/sca-java-1.x/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/ThreadMessageContext.java @@ -69,4 +69,12 @@ public final class ThreadMessageContext { public static Message getMessageContext() { return CONTEXT.get(); } + + /** + * Removes and state from the current thread to ensure that + * any associated classloaders can be GCd + */ + public static void removeMessageContext() { + CONTEXT.remove(); + } } |