A few strategic stack traces can demonstrate the logic for calling an extension. The simplest (semi-useful) case is the AccessCounter:
The extension may be constructed and initialized in one of two ways, it may be hard-wired:
or dynamicly loaded:
Once intialized, the extension will be called upon to generate
or handle headers
when requesting access to resources that require them.
If, during during header generation or handling, the extension needs to create a mapping and instance data, it will do so and pass the instance to the curent request. This may happen when generating headers
or handling headers.
It may seem odd to have the extension generate instances and ask the PEPAgent for them, rather than having the PEPAgent dispatch them itself, but some extensions may be triggered when there are no headers, or when other, well-known headers are transmitted. Additionally, the extension may be called upon to generate an informative policy declaration when a request comes in without the that extension mapped.