KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > admin > event > MonitoringLevelChangeEvent


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 package com.sun.enterprise.admin.event;
24
25 /**
26  * MonitoringLevelChangeEvent is used to represent change in the Monitoring
27  * level for a component. Monitoring levels and components are configured in
28  * the configuration file element monitoring-service.
29  */

30 public class MonitoringLevelChangeEvent extends AdminEvent {
31
32     /**
33      * Event type
34      */

35     static final String JavaDoc eventType = MonitoringLevelChangeEvent.class.getName();
36
37     /**
38      * Monitored component name
39      */

40     private String JavaDoc componentName;
41  
42     /**
43      * Old monitoring level
44      */

45     private String JavaDoc oldMonitoringLevel;
46
47     /**
48      * New monitoring level
49      */

50     private String JavaDoc newMonitoringLevel;
51
52     /**
53      * Creates a new instance of MonitoringLevelChangeEvent
54      * @param instanceName the server instance affected by the change
55      */

56     public MonitoringLevelChangeEvent(String JavaDoc instanceName) {
57         this(eventType, instanceName);
58     }
59
60     /**
61      * Creates a new instance of MonitoringLevelChangeEvent
62      * @eventType type of the event
63      * @param instanceName the server instance affected by the change
64      */

65     protected MonitoringLevelChangeEvent(String JavaDoc eventType, String JavaDoc instanceName) {
66         super(eventType, instanceName);
67     }
68
69     /**
70      * Get name of the component for which Monitoring level has changed. The name
71      * of the component is defined in the dtd for configuration.
72      */

73     public String JavaDoc getComponentName() {
74         return componentName;
75     }
76
77     /**
78      * Set component name.
79      * @param componentName name of the component for which the event is being created
80      */

81     void setComponentName(String JavaDoc componentName) {
82         this.componentName = componentName;
83     }
84
85     /**
86      * Get old monitoring level for the component returned by method
87      * getComponentName(). The monitoring levels are defined in dtd for
88      * configuration
89      */

90     public String JavaDoc getOldMonitoringLevel() {
91         return oldMonitoringLevel;
92     }
93
94     /**
95      * Set old Monitoring level
96      */

97     void setOldMonitoringLevel(String JavaDoc oldLevel) {
98         oldMonitoringLevel = oldLevel;
99     }
100
101     /**
102      * Get new monitoring level for the component returned by method
103      * getComponentName(). The monitoring levels are defined in the dtd for
104      * configuration.
105      */

106     public String JavaDoc getNewMonitoringLevel() {
107         return newMonitoringLevel;
108     }
109
110     /**
111      * Set new monitoring level
112      */

113     void setNewMonitoringLevel(String JavaDoc newLevel) {
114         this.newMonitoringLevel = newLevel;
115     }
116     
117 }
118
Popular Tags