Check out the new USENIX Web site. next up previous
Next: Dynamic adaptation facilities Up: DITOOLS Previous: Interposition on top of

Extension execution modes

To simplify design and implementation of extensions, DITOOLS allows two modes of extension execution: wrapper and callback. The wrapper mode can be seen as `plain interposition'. This mode requires providing routines that match the interface on which they will be interposed. The callback mode is a refinement that allows a routine to be invoked regardless of the interface being intercepted. This refinement is especially convenient when building extensions for monitoring purposes, as well as when the interface is not known.

Both modes are depicted in Figure 3. The wrapper mode is shown in the left side of this figure. Observe that the wrapper is invoked by the application as the effective service definition. Therefore, the wrapper should present the same interface to the application. The callback mode appears in the right side of the figure. In this mode, DITOOLS transparently interposes a callback dispatcher instead of the extension routine. This dispatcher will invoke the routines `aside' of the service definition, without need of knowing the implied interface. Callback handlers have a fixed interface (as illustrated in Section 4), which is determined by the callback dispatcher that calls them. The dispatcher is also the responsible of invoking the original service definition, as if nothing happened.

   figure852
Figure 3: Wrapper and callback modes of extension execution

Extensions can provide their own dispatchers to enable different ways of invoking extension code, for instance to allow multiple handlers for the same event, as in other frameworks [14] [15].



Albert Serra, DITools, 2000 USENIX Annual Technical Conference
Tue Apr 25 13:07:07 MET DST 2000