I would like to add that my need (an external authentication and
auto-registration feature)required completion of its operation before
XWiki received the request.
If AWStats doesn't fill your need, there is also the XWiki notification
interface, with which I am not yet familiar enough to describe it fully,
but I believe that its rules are searched on every request, giving you
the insertion point that you need as well as the full XWiki context that
may also be required.
brain[sic]