[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/appsetup/appsetup.py Install activity monitor into configured databases.

Jim Fulton jim at zope.com
Mon Apr 30 13:47:47 EDT 2007


Log message for revision 74940:
  Install activity monitor into configured databases.
  

Changed:
  U   Zope3/trunk/src/zope/app/appsetup/appsetup.py

-=-
Modified: Zope3/trunk/src/zope/app/appsetup/appsetup.py
===================================================================
--- Zope3/trunk/src/zope/app/appsetup/appsetup.py	2007-04-30 17:37:21 UTC (rev 74939)
+++ Zope3/trunk/src/zope/app/appsetup/appsetup.py	2007-04-30 17:47:46 UTC (rev 74940)
@@ -17,6 +17,7 @@
 """
 __docformat__ = 'restructuredtext'
 
+import ZODB.ActivityMonitor
 import ZODB.interfaces
 import zope.interface
 import zope.component
@@ -159,6 +160,10 @@
     ...         self.number = number
     ...     def __repr__(self):
     ...         return "DB(%s)" % self.number
+    ...     def getActivityMonitor(self):
+    ...         return self._activity_monitor
+    ...     def setActivityMonitor(self, am):
+    ...         self._activity_monitor = am
 
     >>> class Factory:
     ...     def __init__(self, name, number):
@@ -191,6 +196,13 @@
     ...  for name in m]
     [True, True, True]
 
+    And has an activity monitor:
+
+    >>> [isinstance(db.getActivityMonitor(),
+    ...             ZODB.ActivityMonitor.ActivityMonitor)
+    ...  for db in m.values()]
+    [True, True, True]
+
     """
     databases = {}
     result = []
@@ -207,6 +219,7 @@
         if not ZODB.interfaces.IDatabase.providedBy(db):
             zope.interface.directlyProvides(db, ZODB.interfaces.IDatabase)
         zope.component.provideUtility(db, ZODB.interfaces.IDatabase, name)
+        db.setActivityMonitor(ZODB.ActivityMonitor.ActivityMonitor())
         result.append(db)
 
     return result, databases



More information about the Zope3-Checkins mailing list