cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r490944 - in /cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon: components/treeprocessor/ConcreteTreeProcessor.java core/container/spring/Container.java
Date Fri, 29 Dec 2006 07:46:23 GMT
Author: cziegeler
Date: Thu Dec 28 23:46:22 2006
New Revision: 490944

URL: http://svn.apache.org/viewvc?view=rev&rev=490944
Log:
Move shutdown method to tree processor as this is client specific

Modified:
    cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/treeprocessor/ConcreteTreeProcessor.java
    cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/core/container/spring/Container.java

Modified: cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/treeprocessor/ConcreteTreeProcessor.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/treeprocessor/ConcreteTreeProcessor.java?view=diff&rev=490944&r1=490943&r2=490944
==============================================================================
--- cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/treeprocessor/ConcreteTreeProcessor.java
(original)
+++ cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/treeprocessor/ConcreteTreeProcessor.java
Thu Dec 28 23:46:22 2006
@@ -46,6 +46,8 @@
 import org.apache.cocoon.sitemap.SitemapExecutor;
 import org.apache.cocoon.util.location.Location;
 import org.apache.cocoon.util.location.LocationImpl;
+import org.springframework.beans.factory.config.ConfigurableBeanFactory;
+import org.springframework.context.ConfigurableApplicationContext;
 import org.springframework.web.context.WebApplicationContext;
 
 /**
@@ -340,8 +342,14 @@
         // clear listeners
         this.enterSitemapEventListeners.clear();
         this.leaveSitemapEventListeners.clear();
-        Container.shutdown(this.webAppContext);
-        this.webAppContext = null;
+        if ( this.webAppContext != null ) {
+            if ( webAppContext instanceof ConfigurableApplicationContext ) {
+                ((ConfigurableApplicationContext)webAppContext).close();
+            } else if ( webAppContext instanceof ConfigurableBeanFactory ) {
+                ((ConfigurableBeanFactory)webAppContext).destroySingletons();
+            }
+            this.webAppContext = null;
+        }
     }
 
     private class TreeProcessorRedirector extends ForwardRedirector {

Modified: cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/core/container/spring/Container.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/core/container/spring/Container.java?view=diff&rev=490944&r1=490943&r2=490944
==============================================================================
--- cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/core/container/spring/Container.java
(original)
+++ cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/core/container/spring/Container.java
Thu Dec 28 23:46:22 2006
@@ -19,8 +19,6 @@
 import javax.servlet.ServletContext;
 
 import org.apache.cocoon.spring.impl.ServletContextFactoryBean;
-import org.springframework.beans.factory.config.ConfigurableBeanFactory;
-import org.springframework.context.ConfigurableApplicationContext;
 import org.springframework.web.context.WebApplicationContext;
 import org.springframework.web.context.request.RequestAttributes;
 import org.springframework.web.context.request.RequestContextHolder;
@@ -93,14 +91,6 @@
             attributes.removeAttribute(CONTAINER_REQUEST_ATTRIBUTE, RequestAttributes.SCOPE_REQUEST);
         } else {
             attributes.setAttribute(CONTAINER_REQUEST_ATTRIBUTE, info.webAppContext, RequestAttributes.SCOPE_REQUEST);
-        }
-    }
-
-    public static void shutdown(WebApplicationContext webAppContext) {
-        if ( webAppContext instanceof ConfigurableApplicationContext ) {
-            ((ConfigurableApplicationContext)webAppContext).close();
-        } else if ( webAppContext instanceof ConfigurableBeanFactory ) {
-            ((ConfigurableBeanFactory)webAppContext).destroySingletons();
         }
     }
 



Mime
View raw message