comparison Lib/IMPL/Web/Application.pm @ 339:97628101b765

refactoring: application now holds a security object factory rather than a security object
author cin
date Wed, 19 Jun 2013 03:25:44 +0400
parents 63709a4e6da0
children ec58c47edb52
comparison
equal deleted inserted replaced
338:c78dfbe658bd 339:97628101b765
60 my $action = $this->actionFactory->new( 60 my $action = $this->actionFactory->new(
61 query => $q, 61 query => $q,
62 application => $this, 62 application => $this,
63 ); 63 );
64 64
65 $this->BeforeProcessRequest($action);
66
67 eval { 65 eval {
68 my $result = $handler->($action); 66 my $result = $handler->($action);
69 67
70 die InvalidOperationException->new("Invalid handlers result. A reference to IMPL::Web::HttpResponse is expexted.") 68 die InvalidOperationException->new("Invalid handlers result. A reference to IMPL::Web::HttpResponse is expexted.")
71 unless eval { $result->isa(HttpResponse) }; 69 unless eval { $result->isa(HttpResponse) };
72 70
73 $result->PrintResponse( $this->output ); 71 $result->PrintResponse( $this->output );
74 }; 72 };
75 73
76 $this->AfterProcessRequest($action); 74 $action->Dispose();
75
77 if ($@) { 76 if ($@) {
78 my $e = $@; 77 my $e = $@;
79 78
80 HttpResponse->InternalError( 79 HttpResponse->InternalError(
81 type => 'text/plain', 80 type => 'text/plain',
130 die new IMPL::InvalidArgumentException( "An invalid handler supplied", 129 die new IMPL::InvalidArgumentException( "An invalid handler supplied",
131 $handler ); 130 $handler );
132 } 131 }
133 } 132 }
134 133
135 sub BeforeProcessRequest {
136
137 }
138
139 sub AfterProcessRequest {
140
141 }
142
143 1; 134 1;
144 135
145 __END__ 136 __END__
146 137
147 =pod 138 =pod