Themelia Pro A powerful new development platform built on ASP.NET.
 
Understanding Override Processors
 
 

Override processors are a bit similar to init processors and selection processors. However, these are the very last processors to run in the route selection process. In fact, route selection has already occured at this point. This means that you are given one last chance to override something a previous processor or even the route selection process may have done. In fact, this is where you could set a handler if the route selection process didn't, or if you want to switch to a different HTTP handler based on some custom logic.

An override processor is made by creating a class that inherits from Themelia.Web.Processign.OverrideProcessorBase. This is an abstract class that requires you to implement the following signature:

System.Web.IHttpHandler Execute(System.Web.HttpContext context, System.Web.IHttpHandler activeHttpHandler, params Object[] parameterArray)

As you can see from this signature, the currently active HTTP handler comes in as a parameter. This means you may use the HTTP handler at this point. Remember, it's just a class like any other, with properties and all. Perhaps you would like to set some of these properties or even call a handler method.

By returning an HTTP handler, you are effectively override the route selection process. By returning null, the existing HTTP handler remains and routing continues as usual.

Skipping Override Processing

One final note that shouldn't be overlooked is that at any point in the Themelia pipeline, you can send a signal to skip override-processing. This should obviously be used with extreme caution, but if you do want to skips this processors, you may call the FlowControl.SkipOverrideProcessing() method and override processing won't execute.