Author: shuber
Date: Thu Oct 18 16:38:14 2007
New Revision: 18937
URL: https://svndev.jahia.net/websvn/listing.php?sc=3D1&rev=3D18937&repname=
=3Djahia
Log:
Mark non-existant entries in cache
Modified:
trunk/core/src/java/org/jahia/services/files/JahiaTextFileBaseService.j=
ava
Modified: trunk/core/src/java/org/jahia/services/files/JahiaTextFileBaseSer=
vice.java
URL: https://svndev.jahia.net/websvn/diff.php?path=3D/trunk/core/src/java/o=
rg/jahia/services/files/JahiaTextFileBaseService.java&rev=3D18937&repname=
=3Djahia
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/core/src/java/org/jahia/services/files/JahiaTextFileBaseService.j=
ava (original)
+++ trunk/core/src/java/org/jahia/services/files/JahiaTextFileBaseService.j=
ava Thu Oct 18 16:38:14 2007
@@ -58,6 +58,11 @@
=
private CacheService cacheService;
=
+ static class DummyCacheMarker { =
+ }
+
+ private static final DummyCacheMarker DUMMY_CACHE_MARKER =3D new Dummy=
CacheMarker();
+
public void setCacheService(CacheService cacheService) {
this.cacheService =3D cacheService;
}
@@ -133,18 +138,27 @@
{
String fileName =3D FileUtils.getInstance().composeBigTextFileName=
Part(jahiaID, pageID, fieldID, versionID, workflowState, languageCode);
String fullPath =3D FileUtils.getInstance ().composeBigTextFullPat=
hName (jahiaDataDiskPath, fileName);
- String result =3D (String)cacheText.get (fileName);
+ String strResult =3D null;
+ Object result =3D cacheText.get (fileName);
if (result =3D=3D null) {
if (FileUtils.getInstance ().fileExists (fullPath)) {
result =3D FileUtils.getInstance ().readFile (fullPath, la=
nguageCode);
} else {
result =3D fieldValue;
}
+ if (result =3D=3D null) {
+ result =3D DUMMY_CACHE_MARKER;
+ }
cacheText.put (fileName, result);
}
+ if (result =3D=3D DUMMY_CACHE_MARKER) {
+ strResult =3D null;
+ } else {
+ strResult =3D (String) result;
+ }
logger.debug ("File : " + fullPath + ", value : " + result);
=
- return result;
+ return strResult;
}
=
/**
_______________________________________________
cvs_list mailing list
[email protected]
http://lists.jahia.org/cgi-bin/mailman/listinfo/cvs_list