PersistentObject

Objects wishing to be persistent should usually derive from this class: it implements the dopy_afterMethod() method to write the object after every method invocation.

Alternatively, users may wish to implement this functionality themselves so as to be more selective about when they write the object. If you choose to implement this yourself, you may also wish to implement the _dopy_setpath() method to allow the pathname of the object to be communicated upon activation.

Methods

__init__(self)

   def __init__(self):

_acquire(self)

   def _acquire(self):

Manages the cache. Derived classes should call this if they override dopy_beforeMethod().

_release(self)

   def _release(self):

Manages the cache. Derived classes should call this if they override dopy_afterMethod().

dopy_afterMethod(self, request, response)

   def dopy_afterMethod(self, request, response):

Called by dopy.Hub.__processRequest() after a remote method invocation. Writes self to its file.

dopy_beforeMethod(self, request)

   def dopy_beforeMethod(self, request):

Called by dopy.Hub.__processRequest() before a remote method invocation. Increments the use count associated with self in the cache.

dopy_setPath(self, pathname)

   def dopy_setPath(self, pathname):

Called by FileSysDirectory upon loading the object. Sets the path so that the object can be saved to the correct file by dopy_afterMethod().