# ColdBox Mode Listener

![](/files/-LA-Us3mbWYmQ-p5vl3Q)

In ColdBox, you will create [ColdBox Interceptors](https://coldbox.ortusbooks.com/) to listen to any event in the application.  Each of these methods that listen to events receive the following arguments:

<table data-header-hidden><thead><tr><th width="129.33333333333331">Argument</th><th width="191">Type</th><th>Description</th></tr></thead><tbody><tr><td><strong>Argument</strong></td><td><strong>Type</strong></td><td><strong>Description</strong></td></tr><tr><td><strong>event</strong></td><td><code>RequestContext</code></td><td>The request context of the running request</td></tr><tr><td><strong>data</strong></td><td><code>struct</code></td><td>The data structure passed in the event</td></tr><tr><td><strong>buffer</strong></td><td><code>RequestBuffer</code></td><td>A request buffer object for producing elegant content in ColdBox applications</td></tr><tr><td><strong>rc</strong></td><td><code>struct</code></td><td>Reference to the <code>rc</code> scope</td></tr><tr><td><strong>prc</strong></td><td><code>struct</code></td><td>Reference to the <code>prc</code> scope</td></tr></tbody></table>

### Example

So, let's say we want to listen to the `beforeInjectorShutdown` and the `afterInstanceCreation` event in our listener.

```javascript
component{

    function configure(){}

    function beforeInjectorShutdown(event, data, buffer, rc, prc ){
        var injector = arguments.data.injector;
        // Do my stuff here:

        // I can use a log object because ColdBox is cool and injects one for me already.
        log.info("DUDE, I am going down!!!");
    }

    function afterInstanceCreation(event, data, buffer, rc, prc ){
        var injector = arguments.data.injector;
        var target = arguments.data.target;
        var mapping = arguments.data.mapping;

        log.info("The object #mapping.getName()# has just been built, performing my awesome AOP processing on it.");

        // process awesome AOP on this target
        processAwesomeAOP( target );
    }
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://wirebox.ortusbooks.com/usage/wirebox-event-model/wirebox-listeners/coldbox-mode-listener.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
