Package foolscap :: Module copyable :: Class IRemoteCopy
[hide private]
[frames] | no frames]

Class IRemoteCopy

source code

zope.interface.Interface --+
                           |
                          IRemoteCopy

This interface defines what a RemoteCopy class must do. RemoteCopy subclasses are used as factories to create objects that correspond to Copyables sent over the wire.

Note that the constructor of an IRemoteCopy class will be called without any arguments.

Instance Methods [hide private]
 
setCopyableState(statedict)
I accept an attribute dictionary name/value pairs and use it to set my internal state.
source code
Class Variables [hide private]
  stateSchema = interface.Attribute("""I return an AttributeDict...
  _InterfaceClass__attrs = {'setCopyableState': <zope.interface....
  __bases__ = (<InterfaceClass zope.interface.Interface>)
  __identifier__ = 'foolscap.copyable.IRemoteCopy'
  __iro__ = (<InterfaceClass foolscap.copyable.IRemoteCopy>, <In...
  __name__ = 'IRemoteCopy'
  __sro__ = (<InterfaceClass foolscap.copyable.IRemoteCopy>, <In...
  _implied = {<InterfaceClass foolscap.copyable.IRemoteCopy>: ()...
  dependents = <WeakKeyDictionary at 142732300>

Inherited from zope.interface.Interface (private): _Element__tagged_values

Method Details [hide private]

setCopyableState(statedict)

source code 

I accept an attribute dictionary name/value pairs and use it to set my internal state.

Some of the values may be Deferreds, which are placeholders for the as-yet-unreferenceable object which will eventually go there. If you receive a Deferred, you are responsible for adding a callback to update the attribute when it fires. [note: RemoteCopyUnslicer.receiveChild currently has a restriction which prevents this from happening, but that may go away in the future]

Some of the objects referenced by the attribute values may have Deferreds in them (e.g. containers which reference recursive tuples). Such containers are responsible for updating their own state when those Deferreds fire, but until that point their state is still subject to change. Therefore you must be careful about how much state inspection you perform within this method.


Class Variable Details [hide private]

stateSchema

Value:
interface.Attribute("""I return an AttributeDictConstraint
    object which places restrictions on incoming attribute values. The\
se
    restrictions are enforced as the tokens are received, before the s\
tate is
    passed to setCopyableState.""")

_InterfaceClass__attrs

Value:
{'setCopyableState': <zope.interface.interface.Method object at 0x881e\
9ac>,
 'stateSchema': <zope.interface.interface.Attribute object at 0x876ad0\
c>}

__iro__

Value:
(<InterfaceClass foolscap.copyable.IRemoteCopy>,
 <InterfaceClass zope.interface.Interface>)

__sro__

Value:
(<InterfaceClass foolscap.copyable.IRemoteCopy>,
 <InterfaceClass zope.interface.Interface>)

_implied

Value:
{<InterfaceClass foolscap.copyable.IRemoteCopy>: (),
 <InterfaceClass zope.interface.Interface>: ()}