Apache::Wombat::Connector - Apache/mod_perl connector
# My/Handler.pm
my $connector = Apache::Wombat::Connector->new(); $connector->setName('Apache connector'); $connector->setScheme('http'); $connector->setSecure(undef)
# ... create a Service as $service # calls $connector->setContainer() internally $service->addConnector($connector);
sub child_init_handler { my $r = shift; $connector->start(); return Apache::Constants::OK; }
sub handler { my $r = shift; $connector->process($r); return $r->status(); }
sub child_exit_handler { my $r = shift; $connector->stop(); return Apache::Constants::OK; }
# httpd.conf: <Location /> SetHandler perl-script PerlChildInitHandler My::Handler::child_init_handler PerlHandler My::Handler::handler PerlChildExitHandler My::Handler::child_exit_handler </Location>
This Connector receives requests from and returns responses to an
Apache web server within which Wombat is embedded. It does not listen
on a socket but rather provides a process()
entry point with which
it receives and returns an Apache instance. It provides HttpRequest
and HttpResponse implementations that delegate many fields and methods
to an underlying Apache::Request instance.
ApacheConnector assumes an Apache 1 & mod_perl 1 single-threaded multi-process environment. It's unknown whether it will work in any other environment.
Requires mod_perl to be compiled with at least one of the following options:
DYNAMIC=1 PERL_TABLE_API=1 EVERYTHING=1
new()
getContainer()
setContainer($container)
Parameters:
getName()
getScheme()
setScheme($scheme)
Parameters:
getSecure()
setSecure($secure)
Parameters:
await()
createRequest()
createResponse()
process($r)
Parameters:
start()
Throws:
stop()
Throws:
mod_perl, Apache, the Apache::Request manpage, the Wombat::Container manpage, the Apache::Wombat::Request manpage, the Apache::Wombat::Response manpage, the Wombat::Exception manpage
Brian Moseley, bcm@maz.org