cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gkossakow...@apache.org
Subject svn commit: r530893 - /cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/java/org/apache/cocoon/servletservice/components/ServletSource.java
Date Fri, 20 Apr 2007 19:17:49 GMT
Author: gkossakowski
Date: Fri Apr 20 12:17:48 2007
New Revision: 530893

URL: http://svn.apache.org/viewvc?view=rev&rev=530893
Log:
* Return validity object only if it holds meaningful value in lastModified field.
  See http://thread.gmane.org/gmane.text.xml.cocoon.cvs/24099/focus=72818 for discussion of
this problem.
  Thanks Alexander Klimetschek for reporting this bug.
* tweaked loggind

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

Modified: cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/java/org/apache/cocoon/servletservice/components/ServletSource.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/java/org/apache/cocoon/servletservice/components/ServletSource.java?view=diff&rev=530893&r1=530892&r2=530893
==============================================================================
--- cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/java/org/apache/cocoon/servletservice/components/ServletSource.java
(original)
+++ cocoon/trunk/core/cocoon-servlet-service/cocoon-servlet-service-components/src/main/java/org/apache/cocoon/servletservice/components/ServletSource.java
Fri Apr 20 12:17:48 2007
@@ -40,6 +40,8 @@
  * @version $Id$
  */
 public class ServletSource extends AbstractSource implements PostableSource {
+	
+	private transient Log logger = LogFactory.getLog(getClass());
     
     private ServletConnection servletConnection;
     /**
@@ -89,7 +91,14 @@
 	}
 
 	public SourceValidity getValidity() {
-		return this.validity;
+		try {
+			connect();
+		} catch (Exception e) {
+			if (logger.isDebugEnabled())
+				logger.debug("Exception occured while making servlet request", e);
+			return null;
+		}
+		return servletConnection.getLastModified() > 0 ? this.validity : null;
 	}
 
 	/**
@@ -145,7 +154,7 @@
 					}
 				} catch (Exception e) {
 					if (logger.isDebugEnabled())
-						logger.debug("Exception occured while checking for validity", e);
+						logger.debug("Exception occured while checking for cache entry for servlet source is
still valid", e);
 					return 0;
 				}
 			}



Mime
View raw message