‪TYPO3CMS  ‪main
TYPO3\CMS\Core\Locking\LockFactory Class Reference
Inheritance diagram for TYPO3\CMS\Core\Locking\LockFactory:
TYPO3\CMS\Core\SingletonInterface

Public Member Functions

 addLockingStrategy (string $className)
 
 removeLockingStrategy (string $className)
 
LockingStrategyInterface createLocker (string $id, int $capabilities=LockingStrategyInterface::LOCK_CAPABILITY_EXCLUSIVE)
 

Protected Attributes

array $lockingStrategy
 

Detailed Description

Factory class to retrieve a locking method

Definition at line 26 of file LockFactory.php.

Member Function Documentation

◆ addLockingStrategy()

TYPO3\CMS\Core\Locking\LockFactory::addLockingStrategy ( string  $className)

Add a locking method.

Parameters
class-string$className

Definition at line 42 of file LockFactory.php.

◆ createLocker()

LockingStrategyInterface TYPO3\CMS\Core\Locking\LockFactory::createLocker ( string  $id,
int  $capabilities = LockingStrategyInterface::LOCK_CAPABILITY_EXCLUSIVE 
)

Get best matching locking method

Parameters
string$id‪ID to identify this lock in the system
int-mask-of<LockingStrategyInterface::LOCK_CAPABILITY_*>‪$capabilities LockingStrategyInterface::LOCK_CAPABILITY_* elements combined with bit-wise OR
Returns
LockingStrategyInterface Class name for a locking method
Exceptions
LockCreateException‪if no locker could be created with the requested capabilities

Definition at line 70 of file LockFactory.php.

◆ removeLockingStrategy()

TYPO3\CMS\Core\Locking\LockFactory::removeLockingStrategy ( string  $className)

Remove a locking method.

Parameters
class-string$className

Definition at line 57 of file LockFactory.php.

Member Data Documentation

◆ $lockingStrategy

array TYPO3\CMS\Core\Locking\LockFactory::$lockingStrategy
protected
Initial value:
= [
SemaphoreLockStrategy::class => true,
FileLockStrategy::class => true,
SimpleLockStrategy::class => true,
]

Definition at line 31 of file LockFactory.php.