Interface n.i.IComponentized(Interface):

Part of nevow.inevow View Source View In Hierarchy

Known subclasses: nevow.inevow.IRequest, nevow.inevow.ISession 0

I am a mixin to allow you to be adapted in various ways persistently.

I define a list of persistent adapters. This is to allow adapter classes to store system-specific state, and initialized on demand. The getComponent method implements this. You must also register adapters for this class for the interfaces that you wish to pass to getComponent.

Many other classes and utilities listed here are present in Zope3; this one is specific to Twisted.
Line # Kind Name Docs
157 Method setComponent Add a component to me for the indicated interface.
162 Method addComponent Add a component to me, for all appropriate interfaces.
179 Method getComponent Create or retrieve an adapter for the given interface.
196 Method unsetComponent Remove my component specified by the given interface class.
199 Method removeComponent Remove the given component from me entirely, for all interfaces for which
def setComponent(interfaceClass, component): (source)
Add a component to me for the indicated interface.
def addComponent(component, ignoreClass=0, registry=None): (source)

Add a component to me, for all appropriate interfaces.

In order to determine which interfaces are appropriate, the component's provided interfaces will be scanned.

If the argument 'ignoreClass' is True, then all interfaces are considered appropriate.

Otherwise, an 'appropriate' interface is one for which its class has been registered as an adapter for my class according to the rules of getComponent.
Returnsthe list of appropriate interfaces
def getComponent(interface, registry=None, default=None): (source)

Create or retrieve an adapter for the given interface.

If such an adapter has already been created, retrieve it from the cache that this instance keeps of all its adapters. Adapters created through this mechanism may safely store system-specific state.

If you want to register an adapter that will be created through getComponent, but you don't require (or don't want) your adapter to be cached and kept alive for the lifetime of this Componentized object, set the attribute 'temporaryAdapter' to True on your adapter class.

If you want to automatically register an adapter for all appropriate interfaces (with addComponent), set the attribute 'multiComponent' to True on your adapter class.
def unsetComponent(interfaceClass): (source)
Remove my component specified by the given interface class.
def removeComponent(component): (source)
Remove the given component from me entirely, for all interfaces for which it has been registered.
Returnsa list of the interfaces that were removed.
API Documentation for Nevow, generated by pydoctor.