KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > avalon > phoenix > interfaces > ApplicationMBean


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.interfaces;
9
10 /**
11  * This is the interface via which you can manager
12  * the root container of Applications.
13  *
14  * @phoenix:mx-topic name="Application"
15  *
16  * @author <a HREF="mailto:peter at apache.org">Peter Donald</a>
17  * @author <a HREF="mailto:leosimons@apache.org">Leo Simons</a>
18  */

19 public interface ApplicationMBean
20 {
21     String JavaDoc ROLE = ApplicationMBean.class.getName();
22
23     /**
24      * Get the name of the application.
25      *
26      * @phoenix:mx-attribute
27      *
28      * @return the name of the application
29      */

30     String JavaDoc getName();
31
32     /**
33      * Get the name to display in Management UI.
34      *
35      * @phoenix:mx-attribute
36      *
37      * @return the name of the application to display in UI
38      */

39     String JavaDoc getDisplayName();
40
41     /**
42      * Get the string used to describe the application in the UI.
43      *
44      * @phoenix:mx-attribute
45      *
46      * @return a short description of the application
47      */

48     String JavaDoc getDescription();
49
50     /**
51      * Get location of Application installation
52      *
53      * @phoenix:mx-attribute
54      *
55      * @return the home directory of application
56      */

57     String JavaDoc getHomeDirectory();
58
59     /**
60      * Get the names of the blocks that compose this Application
61      *
62      * @phoenix:mx-attribute
63      *
64      * @return list of block names
65      */

66     String JavaDoc[] getBlockNames();
67
68     /**
69      * Return true if the application is
70      * running or false otherwise.
71      *
72      * @phoenix:mx-attribute
73      *
74      * @return true if application is running, false otherwise
75      */

76     boolean isRunning();
77
78     /**
79      * Start the application running.
80      * This is only valid when isRunning() returns false,
81      * otherwise it will generate an IllegalStateException.
82      *
83      * @phoenix:mx-operation
84      *
85      * @throws IllegalStateException if application is already running
86      * @throws ApplicationException if the application failed to start.
87      * the message part of exception will contain more information
88      * pertaining to why the application failed to startup
89      */

90     void start()
91         throws IllegalStateException JavaDoc, ApplicationException;
92
93     /**
94      * Shutdown and restart the application running.
95      * This is only valid when isRunning() returns true,
96      * otherwise it will generate an IllegalStateException.
97      * This is equivelent to calling stop() and then start()
98      * in succession.
99      *
100      * @phoenix:mx-operation
101      *
102      * @throws IllegalStateException if application is not already running
103      * @throws ApplicationException if the application failed to stop or start.
104      * the message part of exception will contain more information
105      * pertaining to why the application failed to startup/shutdown
106      */

107     void restart()
108         throws IllegalStateException JavaDoc, ApplicationException;
109
110     /**
111      * Stop the application running.
112      * This is only valid when isRunning() returns true,
113      * otherwise it will generate an IllegalStateException.
114      *
115      * @phoenix:mx-operation
116      *
117      * @throws IllegalStateException if application is not already running
118      * @throws ApplicationException if the application failed to shutdown.
119      * the message part of exception will contain more information
120      * pertaining to why the application failed to shutodwn
121      */

122     void stop()
123         throws IllegalStateException JavaDoc, ApplicationException;
124 }
125
Popular Tags