Author: antelder
Date: Thu Apr 15 08:16:34 2010
New Revision: 934326

URL: http://svn.apache.org/viewvc?rev=934326&view=rev
Log:
Update host webapp to use the new runtime config properties. Add a TODO comment

Modified:
    
tuscany/sca-java-2.x/trunk/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/WebAppHelper.java

Modified: 
tuscany/sca-java-2.x/trunk/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/WebAppHelper.java
URL: 
http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/WebAppHelper.java?rev=934326&r1=934325&r2=934326&view=diff
==============================================================================
--- 
tuscany/sca-java-2.x/trunk/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/WebAppHelper.java
 (original)
+++ 
tuscany/sca-java-2.x/trunk/modules/host-webapp/src/main/java/org/apache/tuscany/sca/host/webapp/WebAppHelper.java
 Thu Apr 15 08:16:34 2010
@@ -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);
             }


Reply via email to