AOP in ContentBox modules

Have been playing around with AOP in ContentBox, in one of my modules. When I wrote a simple one based on the docs, I have no issue seeing the logs that it logs. If I do something like this in the moduleConfig.

binder.mapAspect(“cronusLogger”).to("#moduleMapping#.aop.cronusLoggingAOP");

binder.bindAspect(classes=binder.match().any(),

methods=binder.match().annotatedWith(“cronusLogger”),

aspects=“cronusLogger”);

However, I noticed that you can also do the binding with annotations. Except the following doesn’t work, if I remove the bindAspect from the moduleConfig component and just try to use the following as from the docs.

/**

  • @classMatcher any

  • @methodMatcher annotatedWith:cronusLogger

*/

component implements=“coldbox.system.aop.MethodInterceptor” {

}

I am at a loss to explain this, and have double checked the annotations and don’t see anything wrong.

Luis, you there can you explain why this is not working?

I would have to test it Andrew. Will run the unit tests.

Luis Majano
CEO
Ortus Solutions, Corp
Toll Free/Fax: 1-888-557-8057
Direct: 909-248-3408
www.ortussolutions.com
Twitter: @lmajano, @ortussolutions