Package flumotion :: Package twisted :: Module flavors :: Class StateRemoteCache
[show private | hide private]
[frames | no frames]

Class StateRemoteCache

Unjellyable --+        
              |        
     RemoteCopy --+    
                  |    
  Jellyable --+   |    
              |   |    
   Serializable --+    
                  |    
        RemoteCache --+
                      |
                     StateRemoteCache

Known Subclasses:
AdminAtmosphereState, AdminComponentState, AdminComponentUIState, AdminFlowState, AdminPlanetState, AdminWorkerHeavenState, AdminWorkerState, ManagerComponentUIState, ManagerJobState

I am a remote cache of a state object.
Method Summary
  __init__(self)
  addListener(self, listener, set, append, remove, setitem, delitem, invalidate)
Adds a listener to the remote cache.
  get(self, key, otherwise)
Get the state cache value for the given key.
  hasKey(self, key)
  invalidate(self)
Invalidate this StateRemoteCache.
  keys(self)
  observe_append(self, key, value)
  observe_delitem(self, key, subkey, value)
  observe_remove(self, key, value)
  observe_set(self, key, value)
  observe_setitem(self, key, subkey, value)
  removeListener(self, listener)
  setCopyableState(self, dict)
  _ensureListeners(self)
    Inherited from RemoteCache
  __cmp__(self, other)
Compare me [to another RemoteCache.
  __del__(self)
Do distributed reference counting on finalize.
  __hash__(self)
Hash me.
  jellyFor(self, jellier)
serialize me (only for the broker I'm for) as the original cached reference
  remoteMessageReceived(self, broker, message, args, kw)
A remote message has been received.
  unjellyFor(self, unjellier, jellyList)
    Inherited from Unjellyable
  setStateFor(self, unjellier, state)
    Inherited from Serializable
  processUniqueID(self)
Return an ID which uniquely represents this object for this process.
    Inherited from Jellyable
  getStateFor(self, jellier)

Class Variable Summary
    Inherited from RemoteCache
NoneType broker = None                                                                  
NoneType luid = None                                                                  
    Inherited from RemoteCopy
Implements __implemented__ = <implementedBy twisted.spread.flavors....
ClassProvides __provides__ = <zope.interface.declarations.ClassProvide...
    Inherited from Unjellyable
ClassProvides __providedBy__ = <zope.interface.declarations.ClassProvi...

Method Details

addListener(self, listener, set=None, append=None, remove=None, setitem=None, delitem=None, invalidate=None)

Adds a listener to the remote cache.

The caller will be notified of state events via the functions given as the 'set', 'append', and 'remove', 'setitem', and 'delitem' keyword arguments.

Setting one of the event handlers to None will ignore that event. It is an error for all event handlers to be None.
Parameters:
listener - A new listener object that wants to receive cache state change notifications.
           (type=object implementing flumotion.twisted.flavors.IStateListener)
set - A procedure to call when a value is set
           (type=procedure(object, key, value) -> None)
append - A procedure to call when a value is appended to a list
           (type=procedure(object, key, value) -> None)
remove - A procedure to call when a value is removed from a list
           (type=procedure(object, key, value) -> None)
setitem - A procedure to call when a value is set in a dict.
           (type=procedure(object, key, subkey, value) -> None)
delitem - A procedure to call when a value is removed from a dict.
           (type=procedure(object, key, subkey, value) -> None)
invalidate - A procedure to call when this cache has been invalidated.
           (type=procedure(object) -> None)

get(self, key, otherwise=None)

Get the state cache value for the given key.

Return otherwise in case where key is present but value None.

invalidate(self)

Invalidate this StateRemoteCache.

Calling this method will result in the invalidate callback being called for all listeners that passed an invalidate handler to addListener. This method is not called automatically; it is provided as a convenience to applications.

Generated by Epydoc 2.1 on Mon Oct 1 03:51:54 2007 http://epydoc.sf.net