onPHP

core/Cache/SemaphorePool.class.php Source File

 

SemaphorePool.class.php

Go to the documentation of this file.
00001 <?php
00002 /***************************************************************************
00003  *   Copyright (C) 2005-2006 by Konstantin V. Arkhipov                     *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  *                                                                         *
00010  ***************************************************************************/
00011 /* $Id: SemaphorePool.class.php 3202 2007-04-30 19:01:43Z voxus $ */
00012 
00023     final class SemaphorePool extends BaseLocker implements Instantiatable
00024     {
00025         private static $lockerName  = 'SystemFiveLocker';
00026         private static $locker      = null;
00027         
00028         protected function __construct()
00029         {
00030             self::$locker = Singleton::getInstance(self::$lockerName);
00031         }
00032         
00033         public static function setDefaultLocker($name)
00034         {
00035             self::$lockerName = $name;
00036             self::$locker = Singleton::getInstance($name);
00037         }
00038 
00042         public static function me()
00043         {
00044             return Singleton::getInstance(__CLASS__);
00045         }
00046         
00047         public function get($key)
00048         {
00049             return self::$locker->get($key);
00050         }
00051         
00052         public function free($key)
00053         {
00054             return self::$locker->free($key);
00055         }
00056         
00057         public function drop($key)
00058         {
00059             return self::$locker->drop($key);
00060         }
00061         
00062         public function clean()
00063         {
00064             return self::$locker->clean();
00065         }
00066         
00067         public function __destruct()
00068         {
00069             self::$locker->clean();
00070         }
00071     }
00072 ?>

generated by doxygen-1.5.1
for onPHP at Mon Apr 30 23:10:09 2007