Interceptors and Request Context Decorator, WOW!!

I committed yesterday a more stable build for the interceptors and a
new features for the request context object (event). You can now
decorate it with your own functions or logic. This is very useful when
you need to expand on what the framework gives you as a model for an
incoming request. We all have different applications, requirements and
solutions. This gives you the flexibility to actually decorate an
incoming request with your necessary logic. It is also very easy to
do:

1) coldbox.xml, add a new setting called: "RequestContextDecorator"
and place the instantiation path for your decorator:

<Setting name="RequestContextDecorator"
value="myApp.model.util.myContextDecorator" />

2) Code your decorator. Create a cfc call it what you want, and make
sure it extends: coldbox.system.beans.requestContextDecorator

You can create a 'configure' method to be executed on construction and
the method you need to know to get the original context is called:
"getRequestContext()'

So if you want to override for example the getValue() method so a
blank is returned even if the variable doesn't exist. You can do the
following:

<cffunction name="getValue" output="false" access="public"
returntype="any">
<cfargument name="name" type="string">
<cfargument name="defaultvalue" type="any" required="false"
default="">

<cfscript>
var myDefaultValue = "";

if ( getRequestContext().valueExists(arguments.name) ){
  return getRequestContext().getValue(argumentCollection=arguments);
}
else{
return myDefaultValue;
}

</cfscript>
</cffunction>

You have now decorated the getValue method with a pretty nifty
functionality. Well folks, hope this is exciting news, there are
thousands of applications thanks to this feature and the most
important part is that you are not constricted by the framework. It is
extensible and maintainable.

I will post more on interceptors later.