[Zope3-checkins] CVS: Zope3/lib/python/Zope/App/Caching/RAMCache - RAMCache.py:1.9 configure.zcml:1.3

Marius Gedminas mgedmin@codeworks.lt
Thu, 12 Dec 2002 10:28:46 -0500


Update of /cvs-repository/Zope3/lib/python/Zope/App/Caching/RAMCache
In directory cvs.zope.org:/tmp/cvs-serv24277/lib/python/Zope/App/Caching/RAMCache

Modified Files:
	RAMCache.py configure.zcml 
Log Message:
Caching service now uses the new configuration infrastructure
Added invalidateAll to Zope.App.Caching.ICache



=== Zope3/lib/python/Zope/App/Caching/RAMCache/RAMCache.py 1.8 => 1.9 ===
--- Zope3/lib/python/Zope/App/Caching/RAMCache/RAMCache.py:1.8	Fri Dec  6 04:54:14 2002
+++ Zope3/lib/python/Zope/App/Caching/RAMCache/RAMCache.py	Thu Dec 12 10:28:15 2002
@@ -104,6 +104,13 @@
         else:
             s.invalidate(ob)
 
+
+    def invalidateAll(self):
+        "See Zope.App.Caching.ICache.ICache"
+        s = self._getStorage()
+        s.invalidateAll()
+
+
     def query(self, ob, key=None, default=None):
         "See Zope.App.Caching.ICache.ICache"
         s = self._getStorage()
@@ -263,6 +270,18 @@
                 # self._invalidate_queued() not called to avoid a recursion
         else:
             self._invalidate_queue.append((ob,key))
+
+
+    def invalidateAll(self):
+        """Drop all the cached values.
+        """
+        self.writelock.acquire()
+        try:
+            self._data = {}
+            self._misses = {}
+            self._invalidate_queue = []
+        finally:
+            self.writelock.release()
 
 
     def removeStaleEntries(self):


=== Zope3/lib/python/Zope/App/Caching/RAMCache/configure.zcml 1.2 => 1.3 ===
--- Zope3/lib/python/Zope/App/Caching/RAMCache/configure.zcml:1.2	Mon Nov 25 08:48:06 2002
+++ Zope3/lib/python/Zope/App/Caching/RAMCache/configure.zcml	Thu Dec 12 10:28:15 2002
@@ -8,7 +8,7 @@
         permission="Zope.Public" />
     <require permission="Zope.Public" 
         interface="Zope.App.Caching.RAMCache.IRAMCache." />
-  
+    <implements interface="Zope.App.OFS.Annotation.IAttributeAnnotatable." />
   </content>
 
 <include package=".Views" />