summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/modules/core
diff options
context:
space:
mode:
authorjennthom <jennthom@13f79535-47bb-0310-9956-ffa450edef68>2012-03-08 18:59:27 +0000
committerjennthom <jennthom@13f79535-47bb-0310-9956-ffa450edef68>2012-03-08 18:59:27 +0000
commitbce7b55e6627b6734192fddec8d0212cd1d1ce44 (patch)
treea1d6aea08ef284064c08e0a32ebcdef04f0341d5 /sca-java-2.x/trunk/modules/core
parentd87ef6ea45dbcb67eed5d72f6f38eefa148b75d0 (diff)
Changes to add TUSCANY-3770 to 2.x stream and updates to performance testcase to produce an additional heap dump after uninstalling applications.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1298513 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/core')
-rw-r--r--sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/context/impl/RequestContextImpl.java21
1 files changed, 12 insertions, 9 deletions
diff --git a/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/context/impl/RequestContextImpl.java b/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/context/impl/RequestContextImpl.java
index 5d0527682e..6aaa6186b9 100644
--- a/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/context/impl/RequestContextImpl.java
+++ b/sca-java-2.x/trunk/modules/core/src/main/java/org/apache/tuscany/sca/core/context/impl/RequestContextImpl.java
@@ -65,20 +65,22 @@ public class RequestContextImpl implements RequestContext {
public String getServiceName() {
Message msgContext = ThreadMessageContext.getMessageContext();
- if (msgContext != null){
+ if (msgContext != null &&
+ msgContext.getTo() != null){
return msgContext.getTo().getService().getName();
} else {
- // message in thread context could be null if the user has
- // spun up a new thread inside their component implementation
+ // message in thread context could be null (or the default message where to == null)
+ // if the user has spun up a new thread inside their component implementation
return null;
}
}
public <B> ServiceReference<B> getServiceReference() {
Message msgContext = ThreadMessageContext.getMessageContext();
- if (msgContext == null){
- // message in thread context could be null if the user has
- // spun up a new thread inside their component implementation
+ if (msgContext == null ||
+ msgContext.getTo() == null){
+ // message in thread context could be null (or the default message where to == null)
+ // if the user has spun up a new thread inside their component implementation
return null;
}
// FIXME: [rfeng] Is this the service reference matching the caller side?
@@ -101,9 +103,10 @@ public class RequestContextImpl implements RequestContext {
@SuppressWarnings("unchecked")
public <CB> ServiceReference<CB> getCallbackReference() {
Message msgContext = ThreadMessageContext.getMessageContext();
- if (msgContext == null){
- // message in thread context could be null if the user has
- // spun up a new thread inside their component implementation
+ if (msgContext == null ||
+ msgContext.getTo() == null){
+ // message in thread context could be null (or the default message where to == null)
+ // if the user has spun up a new thread inside their component implementation
return null;
}