KickJava   Java API By Example, From Geeks To Geeks.

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


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 /* __NAME__.java
30  * $Id: StatsHolder.java,v 1.2 2005/12/25 03:52:08 tcfujii Exp $
31  * $Revision: 1.2 $
32  * $Date: 2005/12/25 03:52:08 $
33  * Indentation Information:
34  * 0. Please (try to) preserve these settings.
35  * 1. Tabs are preferred over spaces.
36  * 2. In vi/vim -
37  * :set tabstop=4 :set shiftwidth=4 :set softtabstop=4
38  * 3. In S1 Studio -
39  * 1. Tools->Options->Editor Settings->Java Editor->Tab Size = 4
40  * 2. Tools->Options->Indentation Engines->Java Indentation Engine->Expand Tabs to Spaces = False.
41  * 3. Tools->Options->Indentation Engines->Java Indentation Engine->Number of Spaces per Tab = 4.
42  */

43
44 package com.sun.enterprise.admin.monitor.registry;
45
46 import javax.management.j2ee.statistics.Stats JavaDoc;
47 import javax.management.ObjectName JavaDoc;
48 import java.util.Collection JavaDoc;
49
50
51 /**
52  * Provides the ability to associate various j2ee components
53  * and sub components in a hierarchical tree. Holds references to
54  * underlying Stats objects. On instantiation, the Stats object is
55  * converted to a DynamicMBean instance. When monitoring level is
56  * changed from OFF to LOW or HIGH, the MBean is registered with an
57  * MBeanServer. Calls made to the MBean are delegated to this object
58  * which in turn delegates it to underlying Stats object.
59  * @author Shreedhar Ganapathy <mailto:shreedhar.ganapathy@sun.com>
60  */

61 public interface StatsHolder {
62     /**
63      * Add a child node or leaf to this node.
64      * @param statsHolder
65      */

66     StatsHolder addChild(String JavaDoc name, MonitoredObjectType type);
67     
68     /**
69      * return an array of StatHolder objects each representing a child
70      * of this node.
71      * @return Collection
72      */

73     Collection JavaDoc getAllChildren();
74
75     /**
76      * removes all children belonging to this node.
77      */

78     void removeAllChildren();
79
80     /**
81      * Returns name of this hierarchical node
82      */

83     String JavaDoc getName();
84     
85     /**
86      * Returns type of this hierarchical node
87      */

88     MonitoredObjectType getType();
89     
90     /**
91      * sets this hierarchical node's associated stats object. Used when node was
92      * originally created without a Stats implementation or a new monitoring
93      * level has been set requiring a new Stats registration
94      */

95     void setStats(Stats JavaDoc stats);
96     
97     Stats JavaDoc getStats();
98     
99     void setStatsClass(Class JavaDoc c);
100     
101     Class JavaDoc getStatsClass();
102     
103     void setStatsClassName(String JavaDoc cName);
104     
105     String JavaDoc getStatsClassName();
106
107     /**
108      * Sets the ObjectName pertaining to the MBean for this node.
109      */

110     void setObjectName(ObjectName JavaDoc name);
111     
112     /**
113      * Gets the ObjectName pertaining to the MBean for this node.
114      */

115     ObjectName JavaDoc getObjectName();
116
117     /**
118      * Sets the hierarchically denoted dotted name for this node.
119      */

120     void setDottedName(String JavaDoc dottedName);
121     
122     /**
123      * Gets the hierarchically denoted dotted name for this node.
124      */

125     String JavaDoc getDottedName();
126     
127     /**
128      * Registers a monitoring MBean with the MBeanServer
129      */

130     void registerMBean();
131     
132     /**
133      * Unregisters a monitoring MBean from the MBean Server
134      */

135     void unregisterMBean();
136     
137     void setType(MonitoredObjectType type);
138     
139     StatsHolder getChild(String JavaDoc name);
140     
141     void removeChild(String JavaDoc name);
142 }
143
Popular Tags