[Zope3-checkins] CVS: Zope3/lib/python/Zope/App/StartUp - SiteDefinition.py:1.2.12.2

Ulrich Eck ueck@net-labs.de
Wed, 11 Dec 2002 06:24:33 -0500


Update of /cvs-repository/Zope3/lib/python/Zope/App/StartUp
In directory cvs.zope.org:/tmp/cvs-serv21031

Modified Files:
      Tag: jack-e_scheduler_branch
	SiteDefinition.py 
Log Message:
add support for ServerControl startup_hook in SiteDefinition.start


=== Zope3/lib/python/Zope/App/StartUp/SiteDefinition.py 1.2.12.1 => 1.2.12.2 ===
--- Zope3/lib/python/Zope/App/StartUp/SiteDefinition.py:1.2.12.1	Mon Dec  9 11:11:25 2002
+++ Zope3/lib/python/Zope/App/StartUp/SiteDefinition.py	Wed Dec 11 06:24:33 2002
@@ -28,14 +28,18 @@
 from ServerTypeRegistry import getServerType
 
 # Import Undo-related classes 
-from Zope.ComponentArchitecture import getService
+from Zope.ComponentArchitecture import getService, getUtility
 from Zope.App.Undo.ZODBUndoManager import ZODBUndoManager
 from Zope.App.Undo.IUndoManager import IUndoManager
 from Zope.App.OFS.Content.Folder.RootFolder import RootFolder
+from Zope.App.OFS.ApplicationControl.ServerControl.IServerControl import IServerControl
 from Zope.Server import ZLogIntegration
 from Zope.Server.TaskThreads import ThreadedTaskDispatcher
 from Zope.App.ZopePublication.ZopePublication import ZopePublication
 
+from Zope.Security.SecurityManagement import system_user
+from Zope.Security.SecurityManagement import newSecurityManager
+
 from Persistence.Module import PersistentModuleImporter
 
 import asyncore, zLOG
@@ -151,6 +155,16 @@
 
         for callable, args in self._threads:
             thread.start_new_thread(callable, (self._zodb, ) + args)
+
+        self._ServerControlStartup()
+
+    def _ServerControlStartup(self):
+        """Execute ServerControl Startup Sequence"""
+        old_secman = newSecurityManager(system_user)
+        try:
+            getUtility(None, IServerControl).startup(self._zodb)
+        finally:
+            newSecurityManager(old_secman)
 
     def _initDB(self):
         """Initialize the ZODB and persistence module importer."""