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<class-string, bool>

Methods

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

Properties

$lockingStrategy

protected array<class-string, 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(class-string $className) : void
Parameters
$className : class-string

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
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(class-string $className) : void
Parameters
$className : class-string

        
On this page

Search results