Announcing Interception points in a service

Announcing interceptors couldn’t be easier inside of a controller

announceInterception(“onPlaceOrder”,{order=o});

but I am a little confused how to do this from a service class I created. The docs say…

Announcing Interceptions

There are two ways to announce interceptions:

  1. announceInterception(state, interceptData) inherited by plugins, handlers and interceptors.
  2. getController().getInterceptorService().processState(state,interceptData)’ via the controller.

I don’t have access to either of these methods in my service, so not quite sure what to do here.

You need to use dependency injection for this. You need to inject the interceptor service into your model objects for event announcements.

property name=“eventService” inject=“coldbox:interceptorService”;

eventService.processState()

Luis F. Majano
CEO
Ortus Solutions, Corp
www.ortussolutions.com

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

Social: twitter.com/lmajano facebook.com/lmajano