Introduction

This is very similar to BlockListener in that it is notified during lifecycle of blocks and application. In Java terms the ApplicationListener interface extends BlockListener so it is always informd of both types of events

Events notified

ApplicationListener components are created before any Blocks are created in an Application. They receive notifications before and after the Applictaion is started and stopped.

How to make a block listener

Like normal blocks, an application listener can be LogEnabled and take configuration via Configurable . The special feature is that it must implement ApplicationListener and implement the four methods that are a consequence of that (as well as four from BlockListener ). The following section in assembly.xml causes instantiation of the application listener. It is exactly the same as that for BlockListener :

<listener class="pkg.MyApplicationListener" name="a-suitable-name" />