[Zope3-checkins] CVS: Zope3/lib/python/Zope/App/ComponentArchitecture - NextService.py:1.1.6.1

Jim Fulton jim@zope.com
Fri, 18 Oct 2002 10:22:59 -0400


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

Modified Files:
      Tag: Zope3-Bangalore-TTW-Branch
	NextService.py 
Log Message:
Fixed a bug that occurred when adding TTW adapter services.
The service manager getService method ends up needin adapters to do
it's job. When getting the adapter service, thye get service code
called code that tried to get adapters and ended up needing to get the
adapter service, which caused an infinate recursion.

Added a fix that prevents a service manager from handling getService
requests while already servicing a getService request.


=== Zope3/lib/python/Zope/App/ComponentArchitecture/NextService.py 1.1 => 1.1.6.1 ===
--- Zope3/lib/python/Zope/App/ComponentArchitecture/NextService.py:1.1	Thu Aug  1 14:42:09 2002
+++ Zope3/lib/python/Zope/App/ComponentArchitecture/NextService.py	Fri Oct 18 10:22:28 2002
@@ -34,6 +34,8 @@
 def getNextService(context, name):
     service = queryNextService(context, name)
     if service is None:
+        service = queryNextService(context, name)
+        
         raise ComponentLookupError('service', name)
     return service
     
@@ -47,6 +49,10 @@
 def getNextServiceManager(context):
     """if the context is a service manager or a placeful service, tries
     to return the next highest service manager"""
+
+    # IMPORTANT
+    #
+    # This is not allowed to use any services to get it's job done!
 
     # get this service manager
     sm = getServiceManager_hook(context)