comparison 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
comparison
equal deleted inserted replaced
57:bf59ee1cd506 58:a35b60b16a99
1 package IMPL::Web::Application; 1 package IMPL::Web::Application;
2 use strict; 2 use strict;
3 use warnings; 3 use warnings;
4 4
5 use base qw(IMPL::Object IMPL::Object::Singleton); 5 use base qw(IMPL::Object IMPL::Object::Singleton);
6
7 require IMPL::Web::Application::Action;
8 require IMPL::Web::Application::Response;
9
6 use IMPL::Class::Property; 10 use IMPL::Class::Property;
7 use CGI; 11 use CGI;
8 12
9 BEGIN { 13 BEGIN {
10 public property handlerError => prop_all; 14 public property handlerError => prop_all;
11 public property factoryAction => prop_all; 15 public property factoryAction => prop_all;
16 public property handlersQuery => prop_all;
12 } 17 }
13 18
14 # custom factory 19 # custom factory
15 sub new { 20 sub new {
16 my ($self,$file) = @_; 21 my ($self,$file) = @_;
19 } 24 }
20 25
21 sub Run { 26 sub Run {
22 my ($this) = @_; 27 my ($this) = @_;
23 28
24 while (my $request = $this->fetch_request()) { 29 while (my $query = $this->FetchRequest()) {
25 my $response = new IMPL::Web::Application::Response(request => $request); 30 my $response = new IMPL::Web::Application::Response(request => $query);
31
32 my $action = new IMPL::Web::Application::Action(
33 request => $query,
34 response => $response,
35 application => $this,
36 );
37
38 $action->ChainHandler($_) foreach $this->handlersQuery;
39
40 $action->Invoke();
26 } 41 }
27 } 42 }
28 43
29 { 44 {
30 my $hasFetched = 0; 45 my $hasFetched = 0;