[Zope3-checkins] CVS: Zope3/src/zope/app/applicationcontrol -
configure.zcml:1.8 interfaces.py:1.4 servercontrol.py:NONE
Stephan Richter
srichter at cosmos.phy.tufts.edu
Tue Mar 23 10:52:41 EST 2004
Update of /cvs-repository/Zope3/src/zope/app/applicationcontrol
In directory cvs.zope.org:/tmp/cvs-serv2015/src/zope/app/applicationcontrol
Modified Files:
configure.zcml interfaces.py
Removed Files:
servercontrol.py
Log Message:
Ripped out old shutdown hook code. Replaced code by better utility-based
model.
There are some to-do's missing, such as creating events, allowing graceful
shutdown and restart and so on. It's in TODOLATER.txt.
=== Zope3/src/zope/app/applicationcontrol/configure.zcml 1.7 => 1.8 ===
--- Zope3/src/zope/app/applicationcontrol/configure.zcml:1.7 Mon Mar 8 18:33:38 2004
+++ Zope3/src/zope/app/applicationcontrol/configure.zcml Tue Mar 23 10:52:10 2004
@@ -1,6 +1,5 @@
<configure
xmlns="http://namespaces.zope.org/zope"
- xmlns:server-control="http://namespaces.zope.org/server-control"
i18n_domain="zope"
>
@@ -17,34 +16,9 @@
factory=".runtimeinfo.RuntimeInfo"
permission="zope.ManageApplication" />
- <adapter
- for=".interfaces.IApplicationControl"
- provides=".interfaces.IZODBControl"
- factory=".zodbcontrol.ZODBControl"
- permission="zope.ManageApplication" />
-
- <adapter
- for=".interfaces.IApplicationControl"
- provides=".interfaces.ITranslationDomainControl"
- factory=".translationdomaincontrol.TranslationDomainControl"
- permission="zope.ManageApplication" />
-
<utility
component=".zopeversion.ZopeVersionUtility"
provides=".interfaces.IZopeVersion" />
-
- <utility
- provides=".interfaces.IServerControl"
- factory=".servercontrol.ServerControl"
- permission="zope.ManageApplication"/>
-
- <!-- Hint: Here you see how to register something on Zope shutdown -->
- <server-control:registerShutdownHook
- name="Shutdown logger"
- priority="0"
- call=".servercontrol.shutdownLogger"
- />
-
<!-- Include borwser package -->
=== Zope3/src/zope/app/applicationcontrol/interfaces.py 1.3 => 1.4 ===
--- Zope3/src/zope/app/applicationcontrol/interfaces.py:1.3 Tue Mar 23 08:35:07 2004
+++ Zope3/src/zope/app/applicationcontrol/interfaces.py Tue Mar 23 10:52:10 2004
@@ -17,16 +17,6 @@
"""
from zope.interface import Interface
-class ServerControlError(Exception):
- """Represents an error in the ServerControl."""
-
-class DoublePriorityError(ServerControlError):
- """A second hook was registered for a priority."""
-
-class NotCallableError(ServerControlError):
- """Raisen if a given object is not callable."""
-
-
class IApplicationControl(Interface):
"""The application control instance is usually generated upon startup and
can therefore record the startup time."""
@@ -85,40 +75,26 @@
ServerController instance.
"""
- def shutdown():
- """Shutdown the server gracefully
+ def shutdown(time=0):
+ """Shutdown the server.
- Returns: Nothing
- """
+ The time should be greater-equal 0.
- def restart():
- """Restart the server gracefully
+ If the time is 0, the we do a hard shutdown, i.e. closing all sockets
+ without waiting for tasks to complete.
- Returns: Nothing
+ If the time is not 0, then we will give the tasks 'time' seconds to
+ finish before shutting down.
"""
- def registerShutdownHook(call, priority, name):
- """Register a function that will be callen on server shutdown.
-
- The function needs to takes no argument at all."""
-
+ def restart(time=0):
+ """Restart the server.
-class IZODBControl(Interface):
- """This control manages the state of the ZODB."""
+ The time should be greater-equal 0.
- def getDatabaseSize(db):
- """Return the database size in bytes."""
-
- def pack(db, days):
- """Pack the ZODB. Remove all entries that are older than 'days' days."""
-
-
-class ITranslationDomainControl(Interface):
- """This control manages the state of the translation service."""
-
- def getCatalogsInfo():
- """Return the registered languages."""
-
- def reloadCatalogs(domain, language):
- """reload the named catalogs from file"""
+ If the time is 0, the we do a hard shutdown, i.e. closing all sockets
+ without waiting for tasks to complete.
+ If the time is not 0, then we will give the tasks 'time' seconds to
+ finish before shutting down.
+ """
=== Removed File Zope3/src/zope/app/applicationcontrol/servercontrol.py ===
More information about the Zope3-Checkins
mailing list