cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gkossakow...@apache.org
Subject svn commit: r545867 - /cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/servletservice/DispatcherServlet.java
Date Sun, 10 Jun 2007 11:42:39 GMT
Author: gkossakowski
Date: Sun Jun 10 04:42:38 2007
New Revision: 545867

URL: http://svn.apache.org/viewvc?view=rev&rev=545867
Log:
COCOON-2076: Fixing RCL functionality by reloading servlet map when application context was
reloaded.

Modified:
    cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/servletservice/DispatcherServlet.java

Modified: cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/servletservice/DispatcherServlet.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/servletservice/DispatcherServlet.java?view=diff&rev=545867&r1=545866&r2=545867
==============================================================================
--- cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/servletservice/DispatcherServlet.java
(original)
+++ cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-impl/src/main/java/org/apache/cocoon/servletservice/DispatcherServlet.java
Sun Jun 10 04:42:38 2007
@@ -51,6 +51,10 @@
     /** By default we use the logger for this class. */
     private Log logger = LogFactory.getLog(getClass());
     
+    /** The startup date of the Spring application context used to setup the  {@link #blockServletCollector}.

+     *  TODO: Use a better way to reload {@link #blockServletCollector} when RCL is used,
see COCOON-2076 **/
+    private long applicationContextStartDate;
+    
     /** The servlet collector bean */
     private Map blockServletCollector;
     
@@ -115,12 +119,11 @@
 		return (Class[]) interfaces.toArray(new Class[interfaces.size()]);
 	}
 
-    public Map getBlockServletMap()
-    {
-        if(this.blockServletCollector == null) {
-            final ApplicationContext applicationContext =
-                WebApplicationContextUtils.getRequiredWebApplicationContext(this.getServletContext());
-            this.blockServletCollector = (Map)applicationContext.getBean( "org.apache.cocoon.servletservice.spring.BlockServletMap"
);
+    public Map getBlockServletMap() {
+    	final ApplicationContext applicationContext = WebApplicationContextUtils.getRequiredWebApplicationContext(this.getServletContext());
   
+        if(this.blockServletCollector == null || applicationContext.getStartupDate() != this.applicationContextStartDate)
{
+        	this.applicationContextStartDate = applicationContext.getStartupDate();
+        	this.blockServletCollector = (Map)applicationContext.getBean( "org.apache.cocoon.servletservice.spring.BlockServletMap"
);
         }
         return blockServletCollector;
     }



Mime
View raw message