KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > admin > monitor > registry > MonitoringLevelListener


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23
24 /*
25  * Copyright 2004-2005 Sun Microsystems, Inc. All rights reserved.
26  * Use is subject to license terms.
27  */

28
29 /*
30  * MonitoringLevelListener.java
31  *
32  * Created on August 13, 2003, 2:15 PM
33  */

34
35 package com.sun.enterprise.admin.monitor.registry;
36
37 /**
38  * Implementation of this interface enables notifications to
39  * be received for change in monitoring level from a prior
40  * level to a new one. Monitoring levels are defined by the
41  * constants class MonitoringLevel and are currently defined as
42  * OFF, LOW and HIGH.
43  * @author <href=mailto:shreedhar.ganapathy@sun.com>Shreedhar Ganapathy
44  */

45 public interface MonitoringLevelListener {
46     /**
47      * Sets the monitoring level to a new level. Values are defined by
48      * MonitoringLevel.OFF, MonitoringLevel.LOW, and MonitoringLevel.High
49      * @param level corresponding to MonitoringLevel OFF, LOW or HIGH
50      * @deprecated
51      */

52     public void setLevel(MonitoringLevel level);
53     
54     /**
55      * Method to convey the change in monitoring level. It is a usual practice that
56      * various components may have <em> single instance of listener </em> to listen
57      * to the changes in monitoring-level for various registered Stats objects. This
58      * method gives a context for such components to be returned when it is
59      * called.
60      * @deprecated
61      * @param from the MonitoringLevel before the change
62      * @param to the MonitoringLevel after the change
63      * @param handback the Stats object that was passed to the registry during registration. It
64      * is guaranteed that it will be unchanged by monitoring framework.
65      */

66     public void changeLevel(MonitoringLevel from, MonitoringLevel to,
67         javax.management.j2ee.statistics.Stats JavaDoc handback);
68
69     /**
70      * Method to convey the change in monitoring level. The configuration
71      * of monitoring pertains to certain components like ejb-container, web-container,
72      * orb, transaction-service, connection-pools, thread-pools etc. The third
73      * parameter loosely corresponds to the configuration in domain.xml as follows:
74      * <ul>
75      * <li> connector-connection-pool : MonitoredObjectType#CONNECTOR_CONN_POOL </li>
76      * <li> ejb-container : MonitoredObjectType#EJB </li>
77      * <li> http-service, http-listeners etc. : MonitoredObjectType#HTTP_SERVICE </li>
78      * <li> jdbc-connection-pool : MonitoredObjectType#JDBC_CONN_POOL </li>
79      * <li> orb : MonitoredObjectType#ORB </li>
80      * <li> thread-pool : MonitoredObjectType#THREAD_POOL </li>
81      * <li> transaction-service : MonitoredObjectType#TRANSACTION_SERVICE </li>
82      * <li> web-container : MonitoredObjectType#WEB_COMPONENT </li>
83      * <li> </li>
84      * </ul>
85      * The core components are expected to follow the above.
86      * When the level changes through administrative interfaces, the notification
87      * is sent to the registered listeners for corresponding types and thus the
88      * dynamic reconfiguration is done.
89      * @param from the MonitoringLevel before the change
90      * @param to the MonitoringLevel after the change
91      * @param type the MonitoredObjectType that had the level changed
92      */

93     public void changeLevel(MonitoringLevel from, MonitoringLevel to,
94         MonitoredObjectType type);
95 }
Popular Tags