TYPO3  7.6
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
LockingStrategyInterface Interface Reference
Inheritance diagram for LockingStrategyInterface:
FileLockStrategy SemaphoreLockStrategy SimpleLockStrategy

Public Member Functions

 __construct ($subject)
 
 acquire ($mode=self::LOCK_CAPABILITY_EXCLUSIVE)
 
 release ()
 
 destroy ()
 
 isAcquired ()
 

Static Public Member Functions

static getCapabilities ()
 
static getPriority ()
 

Public Attributes

const LOCK_CAPABILITY_EXCLUSIVE = 1
 
const LOCK_CAPABILITY_SHARED = 2
 
const LOCK_CAPABILITY_NOBLOCK = 4
 

Detailed Description

Interface for locking methods

Definition at line 24 of file LockingStrategyInterface.php.

Constructor & Destructor Documentation

__construct (   $subject)
Parameters
string$subjectID to identify this lock in the system
Exceptions
LockCreateExceptionif the lock could not be created

Implemented in SemaphoreLockStrategy, SimpleLockStrategy, and FileLockStrategy.

Member Function Documentation

acquire (   $mode = self::LOCK_CAPABILITY_EXCLUSIVE)

Try to acquire a lock

Parameters
int$modeLOCK_CAPABILITY_EXCLUSIVE or LOCK_CAPABILITY_SHARED
Returns
bool Returns TRUE if the lock was acquired successfully
Exceptions
LockAcquireExceptionif the lock could not be acquired
LockAcquireWouldBlockExceptionif the acquire would have blocked and NOBLOCK was set

Implemented in SimpleLockStrategy, SemaphoreLockStrategy, and FileLockStrategy.

destroy ( )

Destroys the resource associated with the lock

Returns
void

Implemented in SimpleLockStrategy, FileLockStrategy, and SemaphoreLockStrategy.

static getCapabilities ( )
static
Returns
int LOCK_CAPABILITY_* elements combined with bit-wise OR

Implemented in FileLockStrategy, SimpleLockStrategy, and SemaphoreLockStrategy.

static getPriority ( )
static
Returns
int Returns a priority for the method. 0 to 100, 100 is highest

Implemented in SimpleLockStrategy, FileLockStrategy, and SemaphoreLockStrategy.

isAcquired ( )

Get status of this lock

Returns
bool Returns TRUE if lock is acquired by this locker, FALSE otherwise

Implemented in FileLockStrategy, SimpleLockStrategy, and SemaphoreLockStrategy.

release ( )

Release the lock

Returns
bool Returns TRUE on success or FALSE on failure

Implemented in FileLockStrategy, SimpleLockStrategy, and SemaphoreLockStrategy.

Member Data Documentation

const LOCK_CAPABILITY_EXCLUSIVE = 1

Exclusive locks can be acquired

Definition at line 29 of file LockingStrategyInterface.php.

Referenced by TypoScriptFrontendController\acquireLock().

const LOCK_CAPABILITY_NOBLOCK = 4

Do not block when acquiring the lock

Definition at line 39 of file LockingStrategyInterface.php.

Referenced by TypoScriptFrontendController\acquireLock().

const LOCK_CAPABILITY_SHARED = 2

Shared locks can be acquired

Definition at line 34 of file LockingStrategyInterface.php.