LockFactory implements SingletonInterface

Factory class to retrieve a locking method

Table of Contents

Interfaces

SingletonInterface
"empty" interface for singletons (marker interface pattern)

Properties

$lockingStrategy  : array<string|int, bool>

Methods

addLockingStrategy()  : mixed
Add a locking method
createLocker()  : LockingStrategyInterface
Get best matching locking method
removeLockingStrategy()  : mixed
Remove a locking method

Properties

$lockingStrategy

protected array<string|int, bool> $lockingStrategy = [\TYPO3\CMS\Core\Locking\SemaphoreLockStrategy::class => true, \TYPO3\CMS\Core\Locking\FileLockStrategy::class => true, \TYPO3\CMS\Core\Locking\SimpleLockStrategy::class => true]

Methods

addLockingStrategy()

Add a locking method

public addLockingStrategy(string $className) : mixed
Parameters
$className : string
Tags
throws
InvalidArgumentException

createLocker()

Get best matching locking method

public createLocker(string $id[, int $capabilities = LockingStrategyInterface::LOCK_CAPABILITY_EXCLUSIVE ]) : LockingStrategyInterface
Parameters
$id : string

ID to identify this lock in the system

$capabilities : int = LockingStrategyInterface::LOCK_CAPABILITY_EXCLUSIVE

LockingStrategyInterface::LOCK_CAPABILITY_* elements combined with bit-wise OR

Tags
throws
LockCreateException

if no locker could be created with the requested capabilities

Return values
LockingStrategyInterface

Class name for a locking method

removeLockingStrategy()

Remove a locking method

public removeLockingStrategy(string $className) : mixed
Parameters
$className : string

        
On this page

Search results