Apache Main | Avalon Main | Up |
Guide - What is an Application Listener?IntroductionThis 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 informed of both types of events. Events notifiedApplicationListener components are created before any Blocks are created in an Application. They receive notifications before and after the Application is started and stopped. How to make a block listenerLike 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" /> Guide Contents
|