Mercurial > pub > Impl
diff Lib/IMPL/Web/Application.pm @ 58:a35b60b16a99
Configuration, late activation
author | wizard |
---|---|
date | Fri, 05 Mar 2010 20:14:45 +0300 |
parents | bf59ee1cd506 |
children | 0f3e369553bd |
line wrap: on
line diff
--- a/Lib/IMPL/Web/Application.pm Fri Mar 05 13:59:29 2010 +0300 +++ b/Lib/IMPL/Web/Application.pm Fri Mar 05 20:14:45 2010 +0300 @@ -3,12 +3,17 @@ use warnings; use base qw(IMPL::Object IMPL::Object::Singleton); + +require IMPL::Web::Application::Action; +require IMPL::Web::Application::Response; + use IMPL::Class::Property; use CGI; BEGIN { public property handlerError => prop_all; public property factoryAction => prop_all; + public property handlersQuery => prop_all; } # custom factory @@ -21,8 +26,18 @@ sub Run { my ($this) = @_; - while (my $request = $this->fetch_request()) { - my $response = new IMPL::Web::Application::Response(request => $request); + while (my $query = $this->FetchRequest()) { + my $response = new IMPL::Web::Application::Response(request => $query); + + my $action = new IMPL::Web::Application::Action( + request => $query, + response => $response, + application => $this, + ); + + $action->ChainHandler($_) foreach $this->handlersQuery; + + $action->Invoke(); } }