KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > avalon > phoenix > ApplicationListener


1 /*
2  * Copyright (C) The Apache Software Foundation. All rights reserved.
3  *
4  * This software is published under the terms of the Apache Software License
5  * version 1.1, a copy of which has been included with this distribution in
6  * the LICENSE.txt file.
7  */

8 package org.apache.avalon.phoenix;
9
10 import java.util.EventListener JavaDoc;
11
12 /**
13  * Implementations of this interface receive notifications about
14  * changes to the state of Application.
15  * The implementation <em>must</em> have a zero argument
16  * constructor and is instantiated before any other component of the Server
17  * Application. To receive notification events, the implementation class
18  * should be specified in the <tt>assembly.xml</tt> descriptor.
19  *
20  * @author <a HREF="mailto:peter at apache.org">Peter Donald</a>
21  */

22 public interface ApplicationListener
23     extends EventListener JavaDoc, BlockListener
24 {
25     /**
26      * Notification that a block has just been added
27      * to Server Application.
28      *
29      * @param event the BlockEvent
30      */

31     void blockAdded( BlockEvent event );
32
33     /**
34      * Notification that a block is just about to be
35      * removed from Server Application.
36      *
37      * @param event the BlockEvent
38      */

39     void blockRemoved( BlockEvent event );
40
41     /**
42      * Notification that an application is being started.
43      *
44      * @param applicationEvent the ApplicationEvent
45      *
46      */

47     void applicationStarting( ApplicationEvent applicationEvent ) throws Exception JavaDoc;
48
49     /**
50      * Notification that an application has now started.
51      */

52     void applicationStarted();
53
54     /**
55      * Notification that an application is being stopped.
56      */

57     void applicationStopping();
58
59     /**
60      * Notification that an application has stopped.
61      */

62     void applicationStopped();
63
64     /**
65      * Notification that an application has failed at some moment.
66      * This is for information only as Phoenix will do the right
67      * thing for correct shutdown both before and after this method
68      * is called. The user of this method should NOT call System.exit()
69      *
70      * @param causeOfFailure
71      */

72     void applicationFailure( Exception JavaDoc causeOfFailure );
73 }
74
Popular Tags