Package Modeling :: Package utilities :: Module EditingContextSessioning
[show private | hide private]
[frames | no frames]

Module Modeling.utilities.EditingContextSessioning

EditingContextSessioning provides a set of functions that can be used to bind to an existing sessioning mechanism so that each existing session has its own EditingContext.

Typical usage:

The session_id parameter required by all three methods must be a valid key object for python dictionary.

MT-status: MT-safe

CVS: $Id: EditingContextSessioning.py,v 1.2 2004/07/20 06:21:57 sbigaret Exp $


Function Summary
  getEditingContext(session_id, create)
Returns the EditingContext registered for a given session
  registerEditingContext(session_id, editingContext)
Associates 'editingContext' to 'session_id'.
  unregisterEditingContext(session_id, dispose)
Unregisters the EditingContext corresponding to 'session_id'.

Variable Summary
str __version__ = '1.2'
_RLock editingContextPerSession_lock = <_RLock(None, 0)>
dict __editingContextPerSession = {}
instancemethod lock = threading._RLock.acquire
instancemethod unlock = threading._RLock.release

Function Details

getEditingContext(session_id, create=1)

Returns the EditingContext registered for a given session

Parameters:

session_id -- the identifier of the current session

create (default: true) -- tells what to do when no EditingContext js
registered for 'session_id': if true, the method creates, registers and returns a new EditingContext; otherwise, the method returns None

registerEditingContext(session_id, editingContext)

Associates 'editingContext' to 'session_id'. Any previously registered editing context for this session_id is silently dropped.

unregisterEditingContext(session_id, dispose=1)

Unregisters the EditingContext corresponding to 'session_id'. It silently returns if no EditingContext was registered for 'session_id'.

Parameters:

session_id -- the identifier of the current session

dispose (default: true) -- if true, call dispose() on the unregistered
EditingContext. If false, do nothing, just wait for the garbage collector to trigger it via EditingContext.__del__

Variable Details

__version__

Type:
str
Value:
'1.2'                                                                  

editingContextPerSession_lock

Type:
_RLock
Value:
<_RLock(None, 0)>                                                      

__editingContextPerSession

Type:
dict
Value:
{}                                                                     

Generated by Epydoc 2.1 on Sat Mar 4 13:36:21 2006 http://epydoc.sf.net