Zeta Components - high quality PHP components

Zeta Components Manual :: Docs For Class ezcCacheStackMetaDataStorage

Cache::ezcCacheStackMetaDataStorage

Interface ezcCacheStackMetaDataStorage

Interface that must be implemented by stack meta data storages.

If a storage is capable to store meta data used by an ezcCacheStack, it must implement this interface. Beside the store and restore methods for the meta data itself, it must implement methods to lock and unlock the complete storage, to ensure that meta data is kept consistent and not affected by race conditions of concurring requests.

Source for this file: /Cache/src/interfaces/meta_data_storage.php

Version:   //autogentag//

Method Summary

public void lock( )
Acquire a lock on the storage.
public ezcCacheStackMetaData|null restoreMetaData( )
Restores and returns the meta data struct.
public void storeMetaData( $metaData )
Stores the given meta data struct.
public void unlock( )
Release a lock on the storage.

Methods

lock

void lock( )

Acquire a lock on the storage.

This method acquires a lock on the storage. If locked, the storage must block all other method calls until the lock is freed again using ezcCacheStackMetaDataStorage::unlock(). Methods that are called within the request that successfully acquired the lock must succeed as usual.

restoreMetaData

ezcCacheStackMetaData|null restoreMetaData( )

Restores and returns the meta data struct.

This method fetches the meta data stored in the storage and returns the according object implementing ezcCacheStackMetaData, that was stored using storeMetaData(). The meta data must be stored inside the storage, but should not be visible as normal cache items to the user. If no meta data is found, null must be returned.

storeMetaData

void storeMetaData( ezcCacheStackMetaData $metaData )

Stores the given meta data struct.

This method stores the given $metaData inside the storage. The data must be stored with the same mechanism that the storage itself uses. However, it should not be stored as a normal cache item, if possible, to avoid accedental user manipulation. The class of $metaData must be stored in addition, to reconstruct the correct ezcCacheStackMetaData implementing class on restoreMetaData.

Parameters:
Name Type Description
$metaData ezcCacheStackMetaData

unlock

void unlock( )

Release a lock on the storage.

This method releases the lock of the storage, that has been acquired via ezcCacheStackMetaDataStorage::lock(). After this method has been called, blocked method calls (including calls to lock()) can suceed again.

Documentation generated by phpDocumentor 1.4.3