226 | | Metahandlers are responsible for implementing the semantics of an HLL module for each Apache phase. If a module registers a hook with Apache, mod_parrot will call the metahandler for that hook during that phase. The metahandler then executes the actual HLL handler code specified in the configuration and returns the status. In this way, the metahandler acts as a proxy, hiding the implementation details of the HLL module from Apache and mod_parrot. |
227 | | |
228 | | === Registering Apache Hooks === |
229 | | |
230 | | XXX elaborate on the phase |
231 | | |
232 | | ||'''Apache Phase'''||'''{{{ModParrot;Constant;table key}}}'''||Metahandler Name|| |
| 226 | Metahandlers are responsible for implementing the semantics of an HLL module for each Apache phase. If a module registers a hook with Apache, mod_parrot will call the metahandler for that hook during that phase. The metahandler then executes the actual HLL handler code specified in the configuration and returns the status. In this way, the metahandler acts as a proxy, hiding the implementation details of the HLL module from Apache and mod_parrot. For example, mod_perl6 passes an Apache::RequestRec object to response handlers, but mod_parrot doesn't know that -- it's up to the mod_perl6 metahandler to pass the Apache::RequestRec object to the handler code. |
| 227 | |
| 228 | === Apache Hooks === |
| 229 | |
| 230 | The following Apache phases are supported by mod_parrot: |
| 231 | |
| 232 | ||'''Apache Phase'''||'''{{{ModParrot;Constant;table}}} key'''||Metahandler Name|| |
| 256 | You might be wondering where metahandlers get information like the previously mentioned Apache::RequestRec object. mod_parrot passes a single {{{ModParrot;Context}}} object as the lone argument to every metahandler. This "context" object contains methods for accessing information relevant to the particular phase of a metahandler. During the response phase for instance, the {{{request_rec}}} method returns the current {{{Apache;RequestRec}}} object. That method would return a NULL PMC during a phase like {{{open_logs}}}. |
| 257 | |
| 258 | {{{ModParrot;Context}}} provides the following methods: |
| 259 | ||Method||Returns|| |
| 260 | ||request_rec||the current request record as an Apache;RequestRec object|| |
| 261 | ||server_rec||the current server record as an Apache;ServerRec object (NOT SUPPORTED UNTIL 0.6)|| |
| 262 | ||conn_rec||the current connection record as an Apache::ConnRec object (NOT SUPPORTED UNTIL 0.6)|| |
| 263 | ||csd||||the current connection descriptor (usually a socket) as an unmanaged PMC (NOT SUPPORTED UNTIL 0.6)|| |
| 264 | ||pconf||the configuration pool as an Apache;Pool object|| |
| 265 | ||ptemp||the temporary pool as an Apache;Pool object|| |
| 266 | ||plog||the log pool as an Apache;Pool object|| |
| 267 | ||pchild||the child pool as an Apache;Pool object|| |
| 268 | |