ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilAssQuestionProcessLockerFile Class Reference
+ Inheritance diagram for ilAssQuestionProcessLockerFile:
+ Collaboration diagram for ilAssQuestionProcessLockerFile:

Public Member Functions

 __construct (ilAssQuestionProcessLockFileStorage $lockFileStorage)
 requestPersistWorkingStateLock ()
 releasePersistWorkingStateLock ()
- Public Member Functions inherited from ilAssQuestionProcessLocker
 requestUserSolutionUpdateLock ()
 releaseUserSolutionUpdateLock ()
 requestUserQuestionResultUpdateLock ()
 releaseUserQuestionResultUpdateLock ()
 requestUserPassResultUpdateLock ()
 releaseUserPassResultUpdateLock ()
 requestUserTestResultUpdateLock ()
 releaseUserTestResultUpdateLock ()

Data Fields

const PROCESS_NAME_PERSIST_WORKING_STATE = 'persistWorkingState'

Protected Attributes

 $lockFileStorage
 $lockFileHandles

Private Member Functions

 requestLock ($processName)
 getLockFilePath ($processName)
 releaseLock ($processName)

Detailed Description

Definition at line 12 of file class.ilAssQuestionProcessLockerFile.php.

Constructor & Destructor Documentation

ilAssQuestionProcessLockerFile::__construct ( ilAssQuestionProcessLockFileStorage  $lockFileStorage)
Parameters
ilAssQuestionProcessLockFileStorage$lockFileStorage

Definition at line 29 of file class.ilAssQuestionProcessLockerFile.php.

References $lockFileStorage.

{
$this->lockFileStorage = $lockFileStorage;
$this->lockFileHandles = array();
}

Member Function Documentation

ilAssQuestionProcessLockerFile::getLockFilePath (   $processName)
private

Definition at line 52 of file class.ilAssQuestionProcessLockerFile.php.

References $path.

Referenced by requestLock().

{
$path = $this->lockFileStorage->getPath();
return $path.'/'.$processName.'.lock';
}

+ Here is the caller graph for this function:

ilAssQuestionProcessLockerFile::releaseLock (   $processName)
private

Definition at line 58 of file class.ilAssQuestionProcessLockerFile.php.

Referenced by releasePersistWorkingStateLock().

{
flock($this->lockFileHandles[$processName], LOCK_UN);
fclose($this->lockFileHandles[$processName]);
}

+ Here is the caller graph for this function:

ilAssQuestionProcessLockerFile::releasePersistWorkingStateLock ( )

Reimplemented from ilAssQuestionProcessLocker.

Definition at line 40 of file class.ilAssQuestionProcessLockerFile.php.

References releaseLock().

{
$this->releaseLock(self::PROCESS_NAME_PERSIST_WORKING_STATE);
}

+ Here is the call graph for this function:

ilAssQuestionProcessLockerFile::requestLock (   $processName)
private

Definition at line 45 of file class.ilAssQuestionProcessLockerFile.php.

References getLockFilePath().

Referenced by requestPersistWorkingStateLock().

{
$lockFilePath = $this->getLockFilePath($processName);
$this->lockFileHandles[$processName] = fopen($lockFilePath, 'w');
flock($this->lockFileHandles[$processName], LOCK_EX);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilAssQuestionProcessLockerFile::requestPersistWorkingStateLock ( )

Reimplemented from ilAssQuestionProcessLocker.

Definition at line 35 of file class.ilAssQuestionProcessLockerFile.php.

References requestLock().

{
$this->requestLock(self::PROCESS_NAME_PERSIST_WORKING_STATE);
}

+ Here is the call graph for this function:

Field Documentation

ilAssQuestionProcessLockerFile::$lockFileHandles
protected

Definition at line 24 of file class.ilAssQuestionProcessLockerFile.php.

ilAssQuestionProcessLockerFile::$lockFileStorage
protected

Definition at line 19 of file class.ilAssQuestionProcessLockerFile.php.

Referenced by __construct().

const ilAssQuestionProcessLockerFile::PROCESS_NAME_PERSIST_WORKING_STATE = 'persistWorkingState'

Definition at line 14 of file class.ilAssQuestionProcessLockerFile.php.


The documentation for this class was generated from the following file: