Инструменты пользователя

Инструменты сайта


limb3:en:architecture:lmb_request_dispatching_filter

lmbRequestDispatchingFilter

lmbRequestDispatchingFilter implements lmbInterceptingFilter interface and performs RequestDispatching using some concrete lmbRequestDispatcher.

lmbRequestDispatchingFilter has a factory method to create lmbRequestDispatcher object, as well as factory methods to create ServiceRequestExtractor and lmbActionRequestExtractor.

class lmbRequestDispatchingFilter implements lmbInterceptingFilter
{
  function run($filter_chain)
  {
    $toolkit = lmbToolkit :: instance();
    $request = $toolkit->getRequest();
 
    $dispatcher = $this->_createRequestDispatcher();
    if(!$dispatched_request = $dispatcher->dispatch($request))
      return;
 
    $toolkit->setDispatchedRequest($dispatched_request);
 
    $filter_chain->next();
  }
 
  protected function _createRequestDispatcher()
  {
    $service_extractor = $this->_createServiceExtractor();
    $action_extractor = $this->_createActionExtractor();
    include_once(LPKG_CORE_DIR . '/src/request/lmbRequestDispatcher.class.php');
    return new lmbRequestDispatcher($service_extractor, $action_extractor);
  } 
 
  protected function _createServiceExtractor() {...}
 
  protected function _createActionExtractor() {...}
  [...]
}

You can create your own child lmbRequestDispatchingFilter for your application and pass any special RequestExctrators into lmbRequestDispatcher.

lmbRequestDispatchingFilter puts lmbDispatchedRequest into lmbToolkit in order to make it available for other components of an application.

Обсуждение

Ваш комментарий. Вики-синтаксис разрешён:
   __ __   ___    ___  ______   __  ___
  / // /  / _ \  / _ |/_  __/  /  |/  /
 / _  /  / , _/ / __ | / /    / /|_/ / 
/_//_/  /_/|_| /_/ |_|/_/    /_/  /_/
 
limb3/en/architecture/lmb_request_dispatching_filter.txt · Последние изменения: 2010/11/10 10:02 (внешнее изменение)