WireBox Listeners

In our previous section, we have seen all the events WireBox announces, but how do we listen? There are two ways to build WireBox listeners because there are two modes of operation, but the core is the same.

  1. Listeners are simple CFCs who must create methods that match the name of the event they want to listen to.

  2. If you are running WireBox within a ColdBox application, listeners are Interceptors and you declare them and register them the same way you do with normal interceptors.

These methods can take up to two parameters depending on your mode of operation (standalone or ColdBox). The one main difference between pure Wirebox listeners and ColdBox interceptors is that the configure method for the standalone WireBox is different.

Last updated