Interceptor Registration
// via the controller
controller.getInterceptorService();
// dependency injection
property name="interceptorService" inject="coldbox:interceptorService";public any registerInterceptor([any interceptorClass], [any interceptorObject], [any<struct> interceptorProperties='[runtime expression]'], [any customPoints=''], [any interceptorName])
public any registerInterceptionPoint(any interceptorKey, any state, any oInterceptor)// register yourself to listen to all events declared
controller.getInterceptorService()
.registerInterceptor( interceptorObject=this );
// register yourself to listen to all events declared and register new events: onError, onLogin
controller.getInterceptorService()
.registerInterceptor( interceptorObject=this, customPoints="onError,onLogin" );
// Register yourself to listen to ONLY the afterInstanceAutowire event
controller.getInterceptorService()
.registerInterceptionPoint(
interceptorKey="MyService",
state="afterInstanceAutowire",
oInterceptor=this
);Last updated
Was this helpful?