diff options
author | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2010-04-09 14:00:31 +0000 |
---|---|---|
committer | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2010-04-09 14:00:31 +0000 |
commit | a61fbe6d1907b8c8ce335ceaa4c4f0b30952410b (patch) | |
tree | 626be8cea8c0590e03b1fbf2ea477275e1a9c309 /sca-java-2.x/trunk/modules | |
parent | 4910dda543a66c96f4fabe11bfd3fc45b0aa7c0b (diff) |
Ensure a Node is created for each context
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@932418 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules')
-rw-r--r-- | sca-java-2.x/trunk/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/WebAppHelper.java | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/sca-java-2.x/trunk/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/WebAppHelper.java b/sca-java-2.x/trunk/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/WebAppHelper.java index 7d086cd0f3..35d8c91750 100644 --- a/sca-java-2.x/trunk/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/WebAppHelper.java +++ b/sca-java-2.x/trunk/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/WebAppHelper.java @@ -140,13 +140,20 @@ public class WebAppHelper { servletContext.setAttribute(name, value); } host = getServletHost(servletContext); - Node node = createAndStartNode(servletContext); - servletContext.setAttribute(SCA_NODE_ATTRIBUTE, node); - return host; } catch (ServletException e) { throw new RuntimeException(e); } } + Node node = (Node)servletContext.getAttribute(SCA_NODE_ATTRIBUTE); + if (node == null) { + try { + node = createAndStartNode(servletContext); + } catch (ServletException e) { + throw new RuntimeException(e); + } + servletContext.setAttribute(SCA_NODE_ATTRIBUTE, node); + } + return host; } |