Commits

plightbo  committed d81befe

WW-449: allow the DCM to be overriden

git-svn-id: http://svn.opensymphony.com/svn/webwork/trunk@333573baa09-0c28-0410-bef9-dab3c582ae83

  • Participants
  • Parent commits 47c4eb6

Comments (0)

Files changed (3)

File src/java/com/opensymphony/webwork/lifecycle/ApplicationLifecycleListener.java

 
     public void contextInitialized(ServletContextEvent event) {
         ServletContext application = event.getServletContext();
-        ComponentManager container = new DefaultComponentManager();
+        ComponentManager container = createComponentManager();
         ComponentConfiguration config = loadConfiguration();
 
         config.configure(container, "application");
         application.setAttribute("ComponentConfiguration", config);
     }
 
+    protected DefaultComponentManager createComponentManager() {
+        return new DefaultComponentManager();
+    }
+
     private ComponentConfiguration loadConfiguration() {
         ComponentConfiguration config = new ComponentConfiguration();
         InputStream configXml = Thread.currentThread().getContextClassLoader().getResourceAsStream("components.xml");

File src/java/com/opensymphony/webwork/lifecycle/RequestLifecycleFilter.java

     }
 
     public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
-        ComponentManager container = new DefaultComponentManager();
+        ComponentManager container = createComponentManager();
 
         try {
             if (log.isDebugEnabled()) {
         }
     }
 
+    protected DefaultComponentManager createComponentManager() {
+        return new DefaultComponentManager();
+    }
+
     public void init(FilterConfig filterConfig) throws ServletException {
     }
 

File src/java/com/opensymphony/webwork/lifecycle/SessionLifecycleListener.java

         }
 
         HttpSession session = event.getSession();
-        ComponentManager container = new SessionComponentManager();
+        ComponentManager container = createComponentManager();
         ServletContext application = getServletContext(session);
         ComponentManager fallback = (ComponentManager) application.getAttribute("DefaultComponentManager");
         container.setFallback(fallback);
         session.setAttribute("DefaultComponentManager", container);
     }
 
+    protected DefaultComponentManager createComponentManager() {
+        return new SessionComponentManager();
+    }
+
     public void sessionDestroyed(HttpSessionEvent event) {
     }