- Timestamp:
- 09/28/08 19:29:10 (2 months ago)
- Location:
- lang/php/misc/Hermit/src/Hermit
- Files:
-
- 5 added
- 5 modified
-
Hermit.php (modified) (3 diffs)
-
HermitListener.php (modified) (2 diffs)
-
HermitTransactionManager.php (modified) (1 diff)
-
proxy/HermitCallableProxy.php (added)
-
proxy/HermitCurryProxy.php (added)
-
proxy/HermitDelegateProxy.php (added)
-
proxy/HermitRespondProxy.php (added)
-
tx/AbstractHermitTx.php (modified) (2 diffs)
-
tx/HermitTx.php (modified) (1 diff)
-
valuetype/AbstractHermitValueType.php (added)
Legend:
- Unmodified
- Added
- Removed
-
lang/php/misc/Hermit/src/Hermit/Hermit.php
r19836 r20152 5 5 */ 6 6 class Hermit { 7 protected $proxy; 7 8 protected $listeners = array(); 8 9 protected $delegators = array(); … … 15 16 $class = HermitDaoManager::get($class); 16 17 } 17 $this->proxy = self::__create($class); 18 $proxy = self::__create($class); 19 $this->proxy = self::wrap($proxy, $class); 18 20 } 19 21 public function __call($name, $parameters = array()){ … … 45 47 return HermitClassProxy::delegate($reflector); 46 48 } 49 protected static function wrap(HermitProxy $proxy, $targetClass){ 50 if(HermitTransactionManager::has($targetClass)){ 51 return HermitTransactionManager::createProxy($proxy, $targetClass); 52 } 53 return $proxy; 54 } 47 55 } 48 56 -
lang/php/misc/Hermit/src/Hermit/HermitListener.php
r19775 r20152 5 5 */ 6 6 abstract class HermitListener extends Hermit { 7 public static function listen(Hermit $hermit, $methodName, HermitRespond er$responder){7 public static function listen(Hermit $hermit, $methodName, HermitRespondProxy $responder){ 8 8 if(!isset($hermit->listeners[$methodName])){ 9 9 $hermit->listeners[$methodName] = array(); … … 11 11 $hermit->listeners[$methodName][] = $responder; 12 12 } 13 public static function delegate(Hermit $hermit, $methodName, HermitDelegat or$delgator){13 public static function delegate(Hermit $hermit, $methodName, HermitDelegateProxy $delgator){ 14 14 $hermit->delegators[$methodName] = $delegator; 15 15 } -
lang/php/misc/Hermit/src/Hermit/HermitTransactionManager.php
r19775 r20152 10 10 } 11 11 public static function set($targetClass, HermitTx $tx){ 12 self::$transactionScripts[$targetClass] = $tx;13 12 } 14 13 public static function get($targetClass){ 15 return self::$transactionScripts[$targetClass];16 14 } 17 15 public static function has($targetClass){ 18 return isset(self::$transactionScripts[$targetClass]); 16 } 17 public static function createProxy(HermitProxy $proxy, $targetClass){ 18 $tx = self::get($targetClass); 19 return new HermitCallableProxy($proxy, array($tx, 'proceed')); 19 20 } 20 21 } -
lang/php/misc/Hermit/src/Hermit/tx/AbstractHermitTx.php
r19344 r20152 6 6 abstract class AbstractHermitTx implements HermitTx { 7 7 private $txRule = array(); 8 public function complete(Exception $e){ 8 private $connection; 9 public function hasTransaction(){ 10 } 11 public function begin(){ 12 } 13 public function commit(){ 14 } 15 public function rollback(){ 16 } 17 public function suspend(){ 18 } 19 public function resume(PDO $connection){ 20 } 21 public final function complete(Exception $e){ 9 22 foreach($this->txRule as $rule){ 10 23 try { … … 19 32 return false; 20 33 } 21 public f unction addCommitRule(Exception $e){34 public final function addCommitRule(Exception $e){ 22 35 $this->txRule[] = new HermitTxRule($this, $e, true); 23 36 } 24 public f unction addRollbackRurle(Exception $e){37 public final function addRollbackRurle(Exception $e){ 25 38 $this->txRule[] = new HermitTxRule($this, $e, false); 26 39 } -
lang/php/misc/Hermit/src/Hermit/tx/HermitTx.php
r19344 r20152 5 5 */ 6 6 interface HermitTx { 7 public function hasTransaction(); 8 public function begin(); 9 public function commit(); 10 public function rollback(); 11 public function suspend(); 12 public function resume(PDO $connection); 13 public function proceed(HermitProxy $proxy, $name, array $parameters); 14 public function complete(Exception $e); 15 public function addCommitRule(Exception $e); 16 public function addRollbackRurle(Exception $e); 17 public static function create(); 7 18 }
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)