comparison Lib/IMPL/Web/Application/Action.pm @ 173:aaab45153411

minor bugfixes
author sourcer
date Wed, 14 Sep 2011 18:59:01 +0400
parents 4267a2ac3d46
children d1676be8afcc
comparison
equal deleted inserted replaced
172:068acfe903c3 173:aaab45153411
10 BEGIN { 10 BEGIN {
11 public property application => prop_get | owner_set; 11 public property application => prop_get | owner_set;
12 public property query => prop_get | owner_set; 12 public property query => prop_get | owner_set;
13 public property response => prop_get | owner_set; 13 public property response => prop_get | owner_set;
14 public property responseFactory => prop_get | owner_set; 14 public property responseFactory => prop_get | owner_set;
15 15 public property context => prop_get | owner_set;
16 private property _entryPoint => prop_all; 16 private property _entryPoint => prop_all;
17 } 17 }
18 18
19 sub CTOR { 19 sub CTOR {
20 my ($this) = @_; 20 my ($this) = @_;
21 21
22 $this->responseFactory('IMPL::Web::Application::Response') unless $this->responseFactory; 22 $this->responseFactory('IMPL::Web::Application::Response') unless $this->responseFactory;
23 $this->response( $this->responseFactory->new(query => $this->query) ); 23 $this->response( $this->responseFactory->new(query => $this->query) );
24 $this->context({});
24 } 25 }
25 26
26 sub Invoke { 27 sub Invoke {
27 my ($this) = @_; 28 my ($this) = @_;
28 29
47 48
48 my $delegateNext = $this->_entryPoint(); 49 my $delegateNext = $this->_entryPoint();
49 50
50 if (ref $handler eq 'CODE') { 51 if (ref $handler eq 'CODE') {
51 $this->_entryPoint( sub { 52 $this->_entryPoint( sub {
52 $handler->($this,$delegateNext); 53 $handler->($this,$delegateNext);
53 } ); 54 } );
54 } elsif (ref $handler and UNIVERSAL::isa($handler,'IMPL::Web::QueryHandler')) { 55 } elsif (ref $handler and UNIVERSAL::isa($handler,'IMPL::Web::QueryHandler')) {
55 $this->_entryPoint( sub { 56 $this->_entryPoint( sub {
56 $handler->Invoke($this,$delegateNext); 57 $handler->Invoke($this,$delegateNext);
57 } ); 58 } );