Problem with Custom Interception Points and Beta 2

Hello,
I've started to test ColdBox Beta 3 and have noticed some issues with
custom interception points.

I have an interceptor (let's call it "myInterceptor.cfc") that
contains only one interception method which corresponds to a custom
interception point (it doesn't contain any for the built-in
interception points). When my application loads, I get this error:

"Interceptor: myInterceptor not found in any state:
preEvent,afterAspectsLoad,afterHandlerCreation,afterConfigurationLoad,preProcess,afterPluginCreation."

I checked to make sure that I had declared my custom interception
point in the config file.

Anyway, I put in a "dummy method" for one of the standard interception
points in the interceptor so that the error wouldn't be triggered:

<cffunction name="preEvent" access="public" returntype="void"
output="false" >
      <cfargument name="event" required="true" type="any">
</cffunction>

By doing that, my application now loads. But I then found that my
custom interception point never executed, even though I had properly
called the announceInterception() method.
When I reverted back to Beta 2, (and took out the dummy method in the
interceptor), I didn't get the error and the custom interception point
executed fine.

So it seems like Beta 3 might not be properly registering custom
interception points from coldbox.xml.cfm.

Sorry, the subject of this post should be "Problems with Custom
Interception Points and Beta 3" (not Beta 2)

Tony, you are absolutely right, I have changed this approach. I just fixed it and it is on SVN, and will update the beta 3 bits for this.

By the way, our new registration system, allows you to NOT define the in XML, you can now use annotations. Example, I want to register a brand new custom interception point called: onLuis. This is how I would do it in my interceptor cfc

<cffunction name=“onLuis” returntype=“void” output=“false” interceptionPoint>

Just by you Adding the metadata attribue interceptionPoint to the cffunction, the interceptor service will register the point and then the method. Will makes things easier to develop now!!

Luis F. Majano
President
Ortus Solutions, Corp

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

Very cool, Luis! Thanks for the quick response. I'll check out the
updated code.

thanks,
Tony

Everything works now. I also tried the tried registering the
interception point using metadata as you described and it works great!
I'm liking this move away from xml and towards annotations.

-Tony

I'm about to write my first interceptor and am using 3.0.0 Beta 3.
Could you provide an example of the new setup? Do you have to register
anything in the XML? And how do you pass properties to the interceptor
if you aren't using the XML but rather annotations?

Thanks,
Judah

Judah,

You still register the interceptor in your xml, so coldbox can create it for you and configure it for you. The annotations are only to declare custom interception points “interceptionPoint”. So register it like normal, but now you can omit the custominterceptionpoints element and use the annotations for it.

Luis F. Majano
President
Ortus Solutions, Corp

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

Ah, gotcha. I was trying to figure out how it knew where the
interceptor was, like if it was just scanning the interceptors folder
and autoregistering, etc. Seemed deceptively simple and, indeed, it
was.

Thanks for the clarification Luis.