Indirect lookup via another IComponentKey
Use this in e.g. binding.Obtain to look up something indirectly, like:
class MyClass(binding.Component):
socketURL = "fd:0"
socket = binding.Obtain(
naming.Indirect('socketURL'), adaptTo=[IListeningSocket]
)
Instances of the above class will have a socket attribute that is the
result of looking up the URL provided by the instance's socketURL
attribute at runtime.
Methods
|
|
__init__
findComponent
|
|
__init__
|
__init__ (
self,
key,
default=NOT_GIVEN,
)
Set up an Indirect instance. key must provide IComponentKey
|
|
findComponent
|
findComponent (
self,
component,
default=NOT_GIVEN,
)
|
|