Validating existence of an event

I'm trying to clean up the last bits of my asynchronous event
interceptor and I realized that there is one additional level of
validation I could do. I think.

Basically, I need to check that the event name that is sent in is a
valid event and then check that the data structure that is passed in
has the data that is required for the particular event.

I'm pretty sure that there are utilities in Coldbox for figuring out
registered events but I can't seem to find it. Any thoughts?

The second part, I'm pretty sure is impossible, at least as the way
that the normal implementation goes. Everything is passed in via RC
and there is no way (that I'm aware of) to tell a calling application
what needs to be in the RC for the event to behave. Am I correct in
that belief?

thanks,
Judah

You can talk to the handler service for all your metadata and handler needs. controller.getHandlerService(), look at the API

You can you expand your second question, I am confused.
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

You can talk to the handler service for all your metadata and handler needs.
controller.getHandlerService(), look at the API

Thanks Luis, I'm working on updating using this.

You can you expand your second question, I am confused.

Sorry, I didn't explain very well. What I meant was that there isn't a
way, that I know of, of programmatically figuring out what a handler
needs to do its job. So let's say that you have a method in your
handler that takes the information for a new user, creates the object
and then persists it. The only argument that the handler gets is the
Event object. You would put the username, password, etc over the wire
and it would get put into the RequestCollection. Once inside the
handler method, you would validate the request, makes sure that it
has, inside the RC, what it needs to do its job of creating and saving
a User object.

I was toying around with the idea of doing some sort of validation of
input data in my interceptor before spawning the new request for that
event because once it is down inside a spawned thread, errors (like
validation) tend to get swallowed up.

Basically, a CFC method can advertise what it needs to do its job
through cfargument. As far as I'm aware of, handlers in CB don't have
an equivalent way to advertise what will be needed in the RC.

Not a huge deal, I'll just validate the existence of the event name
that I'm passed when my interceptor is invoked and then let the
programmer deal with validation and returning of errors themselves.

Cheers,
Judah