Does anyone know of a way to get a list or array of handler functions programmatically? Something that might return a list or object back that I could parse through to get the function names.
writeDump( getMetadata( handler ) )
that works on something that is an instance of an object. But I don’t have my handler loaded into an object.
I tried passing the name in and it returned the metadata of the string object i passed in.
Right. It has to be an instance of the object. That’s the only way I’m aware of to get at what you’re wanting to get at.
I suspect it’s undocumented, but there’s probably a way to get at the handlers (objects) from within the CB handler cache.
It’s all “documented” here in our API docs
If you don’t have an instance of the handler, just use getComponentMetadata() as it only needs the invocation path:
If you look at any of the Application templates, they all list out the registered handlers with this code:
<cfloop list="#getSetting(“RegisteredHandlers”)#" index=“handler”>
If you want an instance of the handler, just ask the HandlerService to create it for you.
Just keep in mind, not all methods in the CFC are necessarily “actions” such as implicit event like preX, postX, aroundX, onError, etc. In addition, there could be additional actions you can can legally call in an event handler that won’t show up in the Metadata by using onMissingAction.
Can you tell us what you’re looking to accomplish?
ColdBox Platform Evangelist
Ortus Solutions, Corp
I was testing you. You passed.