cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From reinh...@apache.org
Subject svn commit: r522971 - /cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-webapp-wrapper/src/main/java/org/apache/cocoon/tools/rcl/wrapper/servlet/ReloadingSpringFilter.java
Date Tue, 27 Mar 2007 15:59:19 GMT
Author: reinhard
Date: Tue Mar 27 08:59:18 2007
New Revision: 522971

URL: http://svn.apache.org/viewvc?view=rev&rev=522971
Log:
- don't use utility method of a helper class but close the app context directly

Modified:
    cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-webapp-wrapper/src/main/java/org/apache/cocoon/tools/rcl/wrapper/servlet/ReloadingSpringFilter.java

Modified: cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-webapp-wrapper/src/main/java/org/apache/cocoon/tools/rcl/wrapper/servlet/ReloadingSpringFilter.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-webapp-wrapper/src/main/java/org/apache/cocoon/tools/rcl/wrapper/servlet/ReloadingSpringFilter.java?view=diff&rev=522971&r1=522970&r2=522971
==============================================================================
--- cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-webapp-wrapper/src/main/java/org/apache/cocoon/tools/rcl/wrapper/servlet/ReloadingSpringFilter.java
(original)
+++ cocoon/trunk/tools/cocoon-rcl/cocoon-rcl-webapp-wrapper/src/main/java/org/apache/cocoon/tools/rcl/wrapper/servlet/ReloadingSpringFilter.java
Tue Mar 27 08:59:18 2007
@@ -27,7 +27,6 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.springframework.context.ApplicationContext;
 import org.springframework.web.context.ContextLoader;
 import org.springframework.web.context.WebApplicationContext;
 import org.springframework.web.context.support.ServletContextFactoryBean;
@@ -50,7 +49,7 @@
             ServletException {
         
         if(CocoonReloadingListener.isReload()) {
-            synchronized (this) {            
+            synchronized (this) {         
                 // load the spring context loader from the reloading classloader
                 ClassLoader cl = ReloadingClassloaderManager.getClassLoader(config.getServletContext());
                 ContextLoader springContextLoader = null;
@@ -62,17 +61,19 @@
                 }
 
                 // close old Spring application context
-                if(log.isDebugEnabled()) {                
-                    ApplicationContext oldAc = WebApplicationContextUtils.getRequiredWebApplicationContext(this.config.getServletContext());
-                    this.log.debug("Removing old application context: " + oldAc);      
+                XmlWebApplicationContext oldAc = (XmlWebApplicationContext) 
+                        WebApplicationContextUtils.getRequiredWebApplicationContext(this.config.getServletContext());
+                     oldAc.close();
+                if(log.isDebugEnabled()) {                     
+                    this.log.debug("Removing old application context: " + oldAc);
                 }
-                springContextLoader.closeWebApplicationContext(this.config.getServletContext());
                 this.config.getServletContext().removeAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE);
 
                 // create the new Spring application context
                 ServletContextFactoryBean b = new ServletContextFactoryBean();
                 b.setServletContext(this.config.getServletContext());
-                XmlWebApplicationContext xac = (XmlWebApplicationContext) springContextLoader.initWebApplicationContext(this.config.getServletContext());
+                XmlWebApplicationContext xac = (XmlWebApplicationContext) springContextLoader.
+                        initWebApplicationContext(this.config.getServletContext());
                 if(log.isDebugEnabled()) {
                     log.debug("Reloading Spring application context: " + xac);
                 }



Mime
View raw message