summaryrefslogtreecommitdiffstats
path: root/java/sca/modules/core/src/main
diff options
context:
space:
mode:
authorslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2009-07-28 07:52:26 +0000
committerslaws <slaws@13f79535-47bb-0310-9956-ffa450edef68>2009-07-28 07:52:26 +0000
commitcc0f2b66367070cb9c00d2df4d78292bea5a31fc (patch)
treee0ad4e44e19366235ceadbeafdbd1d94045562f4 /java/sca/modules/core/src/main
parentd908b383f94b5967dba572e41ad73aed9cd0c421 (diff)
Remove the default contents of he thread message context just in case that this is holding onto a classloader. Don't have proof that this is a problem on 2.x but was causing problems on 1.x
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@798432 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/sca/modules/core/src/main')
-rw-r--r--java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/ThreadMessageContext.java12
1 files changed, 10 insertions, 2 deletions
diff --git a/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/ThreadMessageContext.java b/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/ThreadMessageContext.java
index f81e17c49b..13ce6510ae 100644
--- a/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/ThreadMessageContext.java
+++ b/java/sca/modules/core/src/main/java/org/apache/tuscany/sca/core/invocation/ThreadMessageContext.java
@@ -31,10 +31,10 @@ public final class ThreadMessageContext {
private static final ThreadLocal<Message> CONTEXT = new ThreadLocal<Message>() {
@Override
protected synchronized Message initialValue() {
- Message msg = new MessageImpl();
+ //Message msg = new MessageImpl();
// TODO - EPR - What to set as default?
//msg.setFrom(new EndpointReferenceImpl("/"));
- return msg;
+ return null;//msg;
}
};
@@ -70,4 +70,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();
+ }
}