[Zope3-checkins] CVS: Zope3/lib/python/Zope/ComponentArchitecture - GlobalAdapterService.py:1.5

Jim Fulton jim@zope.com
Wed, 4 Dec 2002 03:39:27 -0500


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

Modified Files:
	GlobalAdapterService.py 
Log Message:
Added the getRegisteredMatching method to support adapter browsing.



=== Zope3/lib/python/Zope/ComponentArchitecture/GlobalAdapterService.py 1.4 => 1.5 ===
--- Zope3/lib/python/Zope/ComponentArchitecture/GlobalAdapterService.py:1.4	Thu Aug  1 14:42:17 2002
+++ Zope3/lib/python/Zope/ComponentArchitecture/GlobalAdapterService.py	Wed Dec  4 03:39:26 2002
@@ -35,6 +35,9 @@
         maker -- a callable object that gets an adapter component for
         a context component.
         """
+    def getRegisteredMatching(for_interface=None, provide_interface=None):
+        """To get all the globally registered adapters.
+        """
 
 class GlobalAdapterService:
     
@@ -64,7 +67,8 @@
             raise ComponentLookupError(object, interface)
 
         return result
-
+    
+    
     def queryAdapter(self, object, interface, default=None):
         """see IAdapterService interface"""
         if interface.isImplementedBy(object):
@@ -80,6 +84,18 @@
             result = maker(result)
 
         return result
+
+    def getRegisteredMatching(self,
+                              required_interfaces=None,
+                              provided_interfaces=None,
+                              ):
+        
+        return self.__adapters.getRegisteredMatching(required_interfaces,
+                                                     provided_interfaces)
+        
+  
+
+    
 
     _clear = __init__