00001 <?php 00002 00003 /* 00004 * This file is part of the PEIP package. 00005 * (c) 2010 Timo Michna <timomichna/yahoo.de> 00006 * 00007 * For the full copyright and license information, please view the LICENSE 00008 * file that was distributed with this source code. 00009 */ 00010 00023 class PEIP_Direct_Channel 00024 extends PEIP_ABS_Subscribable_Channel { 00025 00026 00033 public function send(PEIP_INF_Message $message, $timeout = -1){ 00034 $this->dispatchInterceptor($message, 'preSend'); 00035 $sent = $this->doSend($message); 00036 $this->dispatchInterceptor($message, 'postSend', array('sent' => $sent)); 00037 } 00038 00039 00040 00046 protected function doSend(PEIP_INF_Message $message){ 00047 $this->getMessageDispatcher()->notify($message); 00048 return true; 00049 } 00050 00051 00056 public function getMessageDispatcher(){ 00057 return isset($this->dispatcher) ? $this->dispatcher : $this->dispatcher = new PEIP_Iterating_Dispatcher; 00058 } 00059 00060 }