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

Public Member Functions

 __construct (ilTestProcessLockFileStorage $lockFileStorage)
 requestTestStartLockCheckLock ()
 releaseTestStartLockCheckLock ()
 requestRandomPassBuildLock ()
 releaseRandomPassBuildLock ()

Data Fields

const PROCESS_NAME_TEST_START_LOCK_CHECK = 'testStartLockCheck'
const PROCESS_NAME_RANDOM_PASS_BUILD = 'randomPassBuild'

Protected Attributes

 $lockFileStorage
 $lockFileHandles

Private Member Functions

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

Detailed Description

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

Constructor & Destructor Documentation

ilTestProcessLockerFile::__construct ( ilTestProcessLockFileStorage  $lockFileStorage)
Parameters
ilAssQuestionProcessLockFileStorage$lockFileStorage

Definition at line 30 of file class.ilTestProcessLockerFile.php.

References $lockFileStorage.

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

Member Function Documentation

ilTestProcessLockerFile::getLockFilePath (   $processName)
private

Definition at line 63 of file class.ilTestProcessLockerFile.php.

References $path.

Referenced by requestLock().

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

+ Here is the caller graph for this function:

ilTestProcessLockerFile::releaseLock (   $processName)
private

Definition at line 69 of file class.ilTestProcessLockerFile.php.

Referenced by releaseRandomPassBuildLock(), and releaseTestStartLockCheckLock().

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

+ Here is the caller graph for this function:

ilTestProcessLockerFile::releaseRandomPassBuildLock ( )

Reimplemented from ilTestProcessLocker.

Definition at line 51 of file class.ilTestProcessLockerFile.php.

References releaseLock().

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

+ Here is the call graph for this function:

ilTestProcessLockerFile::releaseTestStartLockCheckLock ( )

Reimplemented from ilTestProcessLocker.

Definition at line 41 of file class.ilTestProcessLockerFile.php.

References releaseLock().

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

+ Here is the call graph for this function:

ilTestProcessLockerFile::requestLock (   $processName)
private

Definition at line 56 of file class.ilTestProcessLockerFile.php.

References getLockFilePath().

Referenced by requestRandomPassBuildLock(), and requestTestStartLockCheckLock().

{
$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:

ilTestProcessLockerFile::requestRandomPassBuildLock ( )

Reimplemented from ilTestProcessLocker.

Definition at line 46 of file class.ilTestProcessLockerFile.php.

References requestLock().

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

+ Here is the call graph for this function:

ilTestProcessLockerFile::requestTestStartLockCheckLock ( )

Reimplemented from ilTestProcessLocker.

Definition at line 36 of file class.ilTestProcessLockerFile.php.

References requestLock().

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

+ Here is the call graph for this function:

Field Documentation

ilTestProcessLockerFile::$lockFileHandles
protected

Definition at line 25 of file class.ilTestProcessLockerFile.php.

ilTestProcessLockerFile::$lockFileStorage
protected

Definition at line 20 of file class.ilTestProcessLockerFile.php.

Referenced by __construct().

const ilTestProcessLockerFile::PROCESS_NAME_RANDOM_PASS_BUILD = 'randomPassBuild'

Definition at line 15 of file class.ilTestProcessLockerFile.php.

const ilTestProcessLockerFile::PROCESS_NAME_TEST_START_LOCK_CHECK = 'testStartLockCheck'

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


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