summaryrefslogtreecommitdiffstats
path: root/sca-java-2.x/trunk/modules/host-webapp/src
diff options
context:
space:
mode:
authorantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2010-04-15 08:16:34 +0000
committerantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2010-04-15 08:16:34 +0000
commit6e132ecef6edea96dab622c462471e295f870306 (patch)
tree738e663c32de8734b54238c0f7d8d92f7b749711 /sca-java-2.x/trunk/modules/host-webapp/src
parentd551ff33d2f5d9905725dea354148456ff50ea34 (diff)
Update host webapp to use the new runtime config properties. Add a TODO comment
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@934326 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/host-webapp/src')
-rw-r--r--sca-java-2.x/trunk/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/WebAppHelper.java8
1 files changed, 7 insertions, 1 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 35d8c91750..6f2135ef50 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
@@ -130,16 +130,22 @@ public class WebAppHelper {
public synchronized static ServletHost init(final ServletContext servletContext) {
if (host == null) {
try {
- factory = NodeFactory.getInstance();
+
+ String configValue = servletContext.getInitParameter("org.apache.tuscany.sca.config");
+ factory = NodeFactory.newInstance(configValue);
ExtensionPointRegistry registry = factory.getExtensionPointRegistry();
ServletHostExtensionPoint servletHosts = registry.getExtensionPoint(ServletHostExtensionPoint.class);
servletHosts.setWebApp(true);
+
+ // TODO: why are the init parameters copied to the attributes?
for (Enumeration<String> e = servletContext.getInitParameterNames(); e.hasMoreElements();) {
String name = e.nextElement();
String value = servletContext.getInitParameter(name);
servletContext.setAttribute(name, value);
}
+
host = getServletHost(servletContext);
+
} catch (ServletException e) {
throw new RuntimeException(e);
}