Ok I can see that a custom Request Context Decorator is a one of thing. I am in the need to create a few, one for each module that I create.
So is it possible to do this, and have multiple? And on a side note how would I register this from a Module?
For example I know on the module onLoad() I could easily change the setting requestContextDecorator to that of the CFC. But how would I set this up for a Module is it something like modules.forums.interceptor.request or would it be forums@interceptor.request?
So the question is it possible to get a ticket in to have multiple RCD’s?
Technically, you can wrap the request context in any way you see fit as long as it follows the decorator pattern. However, since you want it for your module ONLY, then I would do this with a preProcess interceptor that only executes when my MODULE executes.
Something like this in pseudo code:
// add eventPattern annotation so only fires when myModule: is detected in event string.
function preProcess(event, interceptData) eventPattern="^myModule/:"{
// create my own context decorator
var myContext = createObject(“component”,“myContent”).init( event );
// replace it
controller.getRequestService().setContext( myContext );
}
Thanks Luis, but I need to ask how this would work if I wanted to do something like this for all my Modules? I don’t think I see a problem, but I just want to concur with you that this will not have any undesired race conditional problems.
Thanks Luis, but I need to ask how this would work if I wanted to do something like this for all my Modules? I don’t think I see a problem, but I just want to concur with you that this will not have any undesired race conditional problems.