Detailed Description

DefaultLockHandler implements the LockHandler interface for relational databases.

It relies on an entity type that implements the PersistentLock interface.

Author
ingo herwig ingo@.nosp@m.wemo.nosp@m.ve.co.nosp@m.m

Definition at line 32 of file DefaultLockHandler.php.

+ Inheritance diagram for DefaultLockHandler:

Public Member Functions

 __construct (PersistenceFacade $persistenceFacade, Session $session, $lockType)
 
 aquireLock (ObjectId $oid, $type, PersistentObject $currentState=null)
 
 releaseLock (ObjectId $oid, $type=null)
 
 releaseLocks (ObjectId $oid)
 
 releaseAllLocks ()
 
 getLock (ObjectId $oid)
 
 updateLock (ObjectId $oid, PersistentObject $object)
 

Public Attributes

const SESSION_VARNAME = 'DefaultLockHandler.locks'
 

Protected Member Functions

 storeLock (Lock $lock)
 
 getAuthUser ()
 
 getSessionLocks ()
 
 addSessionLock (Lock $lock)
 
 removeSessionLock (ObjectId $oid, $type)
 

Constructor & Destructor Documentation

__construct ( PersistenceFacade  $persistenceFacade,
Session  $session,
  $lockType 
)

Constructor.

Parameters
$persistenceFacade
$session
$lockTypeEntity type name of PersistentLock instances

Definition at line 48 of file DefaultLockHandler.php.

Member Function Documentation

aquireLock ( ObjectId  $oid,
  $type,
PersistentObject  $currentState = null 
)
See also
LockHandler::aquireLock()

Implements LockHandler.

Definition at line 62 of file DefaultLockHandler.php.

releaseLock ( ObjectId  $oid,
  $type = null 
)
See also
LockHandler::releaseLock()

Implements LockHandler.

Definition at line 97 of file DefaultLockHandler.php.

releaseLocks ( ObjectId  $oid)
See also
LockHandler::releaseLocks()

Implements LockHandler.

Definition at line 116 of file DefaultLockHandler.php.

releaseAllLocks ( )
See also
LockHandler::releaseAllLocks()

Implements LockHandler.

Definition at line 132 of file DefaultLockHandler.php.

getLock ( ObjectId  $oid)
See also
LockHandler::getLock()

Implements LockHandler.

Definition at line 150 of file DefaultLockHandler.php.

updateLock ( ObjectId  $oid,
PersistentObject  $object 
)
See also
LockHandler::updateLock()

Implements LockHandler.

Definition at line 191 of file DefaultLockHandler.php.

storeLock ( Lock  $lock)
protected

Store the given Lock instance for later retrieval.

Parameters
$lockLock instance

Definition at line 208 of file DefaultLockHandler.php.

getAuthUser ( )
protected

Get the login of the current user.

Returns
String

Definition at line 227 of file DefaultLockHandler.php.

getSessionLocks ( )
protected

Get the Lock instances stored in the session.

Returns
Associative array with the serialized ObjectId instances as keys and the Lock instances as values

Definition at line 236 of file DefaultLockHandler.php.

addSessionLock ( Lock  $lock)
protected

Add a given Lock instance to the session.

Parameters
$lockLock instance

Definition at line 247 of file DefaultLockHandler.php.

removeSessionLock ( ObjectId  $oid,
  $type 
)
protected

Remove a given Lock instance from the session.

Parameters
$oidThe locked oid
$typeOne of the Lock::Type constants or null for all types (default: null)

Definition at line 258 of file DefaultLockHandler.php.

Member Data Documentation

const SESSION_VARNAME = 'DefaultLockHandler.locks'

Definition at line 34 of file DefaultLockHandler.php.