[Zope-Checkins] CVS: Zope3/lib/python/Zope/ComponentArchitecture - IServiceService.py:1.1.2.2 Service.py:1.1.6.4 __init__.py:1.1.6.14

Michael McLay mclay@nist.gov
Sat, 9 Feb 2002 16:13:14 -0500


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

Modified Files:
      Tag: Zope-3x-branch
	IServiceService.py Service.py __init__.py 
Log Message:
Added ServiceManagerBindingView and Service/pt/services_binding.pt.
Moved funtionality from IServiceService to IServiceManager and added
getServiceDefinitions() to Service.py. Changed the name of provideService
in ServiceManager to bindService and modified the functionality to allow
multiple service implementations to be associated with a service definition.



=== Zope3/lib/python/Zope/ComponentArchitecture/IServiceService.py 1.1.2.1 => 1.1.2.2 ===
 class IServiceService(Interface):
 
+    def getServiceDefinitions():
+	"""Retrieve all Service Definitions
+
+	Should return a list of tuples (name, interface)
+	"""
+
+
     def defineService(name, interface):
         """Define a new service"""
-
-    def provideService(name, component):
-        """provide a service implementation"""
+	
 
     def getService(object, name):
-        """retrieve a service implementation"""
+        """retrieve a service implementation
 
+	Default implimentations search the context for the next
+	ServiceService implimentation if the requested Service
+	is not found.
+	"""


=== Zope3/lib/python/Zope/ComponentArchitecture/Service.py 1.1.6.3 => 1.1.6.4 ===
         self.__defs[name] = interface
 
+    def getServiceDefinitions():
+	"""see IServiceService Interface"""
+	return self.__defs.items()
+
     def provideService(self, name, component):
         """provide a service implementation"""
 
@@ -91,3 +95,9 @@
         object = getinnercontext(object)
     return serviceManager.getService(object, name)
 
+def getServiceDefinitions():
+    """
+    get service defintions from component architecture service
+    manager.
+    """
+    return serviceManager.getServiceDefinitions()


=== Zope3/lib/python/Zope/ComponentArchitecture/__init__.py 1.1.6.13 => 1.1.6.14 ===
 from hooks import provideUtility, getUtility
 from hooks import provideFactory, createObject
-from Service import defineService, provideService, getService
+from Service import defineService, provideService, getService, getServiceDefinitions
 from SkinService import getSkin, defineSkin
 from ViewService import getView, provideView, getRequestView
 from ViewService import getDefaultViewName, getRequestDefaultViewName, \