You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by di...@apache.org on 2005/12/20 05:20:51 UTC

svn commit: r357901 - /webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/AxisServlet.java

Author: dims
Date: Mon Dec 19 20:20:46 2005
New Revision: 357901

URL: http://svn.apache.org/viewcvs?rev=357901&view=rev
Log:
Fix for AXIS2-346 - AxisServlet: abstracting initialization of ConfigurationContext from  Alex Boisvert

Modified:
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/AxisServlet.java

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/AxisServlet.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/AxisServlet.java?rev=357901&r1=357900&r2=357901&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/AxisServlet.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/http/AxisServlet.java Mon Dec 19 20:20:46 2005
@@ -183,16 +183,29 @@
      */
     public void init(ServletConfig config) throws ServletException {
         try {
+            configContext = initConfigContext(config);
+            lister = new ListingAgent(configContext);
+            context.setAttribute(CONFIGURATION_CONTEXT, configContext);
+        } catch (Exception e) {
+            throw new ServletException(e);
+        }
+    }
+
+    /**
+     * Initialize the Axis configuration context
+     *
+     * @param config Servlet configuration
+     * @throws ServletException
+     */
+    protected ConfigurationContext initConfigContext(ServletConfig config) throws ServletException {
+        try {
             ServletContext context = config.getServletContext();
             String repoDir = context.getRealPath("/WEB-INF");
             ConfigurationContextFactory erfac = new ConfigurationContextFactory();
-
-            configContext = erfac.buildConfigurationContext(repoDir);
+            ConfigurationContext configContext = erfac.buildConfigurationContext(repoDir);
             configContext.setProperty(Constants.CONTAINER_MANAGED, Constants.VALUE_TRUE);
             configContext.setRootDir(new File(context.getRealPath("/WEB-INF")));
-            lister = new ListingAgent(configContext);
-            context.setAttribute(CONFIGURATION_CONTEXT, configContext);
-
+            return configContext;
         } catch (Exception e) {
             throw new ServletException(e);
         }