| 1 | |||
| 2 | package Apache2::ASP::HTTPContext::HandlerRunner; | ||
| 3 | |||
| 4 | use strict; | ||
| 5 | use warnings 'all'; | ||
| 6 | |||
| 7 | |||
| 8 | #============================================================================== | ||
| 9 | sub new | ||
| 10 | { | ||
| 11 | my ($class, %args) = @_; | ||
| 12 | |||
| 13 | return bless \%args, $class; | ||
| 14 | }# end new() | ||
| 15 | |||
| 16 | |||
| 17 | #============================================================================== | ||
| 18 | sub context { Apache2::ASP::HTTPContext->current } | ||
| 19 | |||
| 20 | |||
| 21 | #============================================================================== | ||
| 22 | sub run_handler | ||
| 23 | { | ||
| 24 | my ($s, $handler_class, $args) = @_; | ||
| 25 | |||
| 26 | my $handler = $handler_class->new(); | ||
| 27 | $handler_class->init_asp_objects( $s->context ); | ||
| 28 | $handler_class->before_run( $s->context, $args ); | ||
| 29 | if( ! $s->{did_end} ) | ||
| 30 | { | ||
| 31 | $handler_class->run( $s->context, $args ); | ||
| 32 | $handler_class->after_run( $s->context, $args ); | ||
| 33 | }# end if() | ||
| 34 | }# end run_handler() | ||
| 35 | |||
| 36 | 1;# return true: | ||
| 37 |