Changes between Version 13 and Version 14 of ModParrotHLLDocs

Show
Ignore:
Timestamp:
12/25/08 21:43:02 (13 years ago)
Author:
jhorwitz
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ModParrotHLLDocs

    v13 v14  
    224224== Metahandlers == 
    225225 
    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|| 
     226Metahandlers 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 
     230The following Apache phases are supported by mod_parrot: 
     231 
     232||'''Apache Phase'''||'''{{{ModParrot;Constant;table}}} key'''||Metahandler Name|| 
    233233||Open logs||{{{MP_HOOK_OPEN_LOGS}}}||open_logs_handler|| 
    234234||Post-configuration||{{{MP_HOOK_POST_CONFIG}}}||post_config_handler|| 
     
    247247||Output Filter||{{{MP_HOOK_OUTPUT_FILTER}}}||TBD 
    248248||MIME Type||{{{MP_HOOK_TYPE}}}||type_handler|| 
    249 ||Fixups||{{{MP_HOOK_FIXUP}}}||fixup_handler 
    250 ||Logging||{{{MP_HOOK_LOG}}}||log_handler 
     249||Fixups||{{{MP_HOOK_FIXUP}}}||fixup_handler|| 
     250||Logging||{{{MP_HOOK_LOG}}}||log_handler|| 
     251 
     252Each hook that an HLL module supports must have a corresponding metahandler with the name indicated above.  It must be declared in the {{{ModParrot;HLL;hllname}}} namespace. 
    251253 
    252254=== The Context Object === 
    253255 
     256You 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 
    254269=== Capturing Output === 
    255270 
     271TODO 
     272 
    256273== Registering the HLL Apache Module == 
    257274