diff options
Diffstat (limited to 'java/sca/modules')
-rw-r--r-- | java/sca/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/ServletHostHelper.java | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/java/sca/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/ServletHostHelper.java b/java/sca/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/ServletHostHelper.java index c3aaf02e3a..c85ce6f265 100644 --- a/java/sca/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/ServletHostHelper.java +++ b/java/sca/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/ServletHostHelper.java @@ -40,6 +40,7 @@ import org.apache.tuscany.sca.node.configuration.NodeConfiguration; import org.apache.tuscany.sca.node.impl.NodeImpl;
public class ServletHostHelper {
+ public static final String DOMAIN_NAME_ATTR = "org.apache.tuscany.sca.domain.name";
public static final String SCA_NODE_ATTRIBUTE = Node.class.getName();
private static NodeFactory factory;
@@ -85,6 +86,7 @@ public class ServletHostHelper { configuration = factory.loadConfiguration(openStream(servletContext, nodeConfigURI));
} else {
configuration = factory.createNodeConfiguration();
+ configuration.setDomainURI(factory.getDomainURI());
Enumeration<String> names = servletContext.getInitParameterNames();
while (names.hasMoreElements()) {
String name = names.nextElement();
@@ -120,7 +122,12 @@ public class ServletHostHelper { Node node = (Node)servletContext.getAttribute(SCA_NODE_ATTRIBUTE);
if (node == null) {
try {
- factory = NodeFactory.newInstance();
+ String domainName = (String)servletContext.getAttribute(DOMAIN_NAME_ATTR);
+ if (domainName != null) {
+ factory = NodeFactory.getInstance(domainName);
+ } else {
+ factory = NodeFactory.newInstance();
+ }
node = createNode(servletContext);
servletContext.setAttribute(SCA_NODE_ATTRIBUTE, node);
getServletHost(node).init(new ServletConfig() {
|