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)
 
 getCurrentUser ()
 
 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 100 of file DefaultLockHandler.php.

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

Implements LockHandler.

Definition at line 122 of file DefaultLockHandler.php.

releaseAllLocks ( )
See also
LockHandler::releaseAllLocks()

Implements LockHandler.

Definition at line 138 of file DefaultLockHandler.php.

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

Implements LockHandler.

Definition at line 159 of file DefaultLockHandler.php.

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

Implements LockHandler.

Definition at line 200 of file DefaultLockHandler.php.

storeLock ( Lock  $lock)
protected

Store the given Lock instance for later retrieval.

Parameters
$lockLock instance

Definition at line 217 of file DefaultLockHandler.php.

getCurrentUser ( )
protected

Get the current user.

Returns
User instance

Definition at line 236 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 245 of file DefaultLockHandler.php.

addSessionLock ( Lock  $lock)
protected

Add a given Lock instance to the session.

Parameters
$lockLock instance

Definition at line 256 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 267 of file DefaultLockHandler.php.

Member Data Documentation

const SESSION_VARNAME = 'DefaultLockHandler.locks'

Definition at line 34 of file DefaultLockHandler.php.