KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > fractal > jmx > agent > AdminAttributes


1 /***
2  * Fractal JMX
3  * Copyright (C) 2001-2002 France Telecom, INRIA
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  *
19  * Contact: fractal@objectweb.org
20  */

21 package org.objectweb.fractal.jmx.agent;
22
23 import org.objectweb.fractal.api.control.AttributeController;
24 import javax.management.MBeanServer JavaDoc;
25
26 /**
27  * Attribute controller of the agent component.
28  * This interface provides attributes for filtering MBeans in the scope of the agent.
29  * Only the MBeans, whose {@link javax.management.ObjectName ObjectName} matches a pattern defined by these attributes,
30  * are registered in the agent.
31  *
32  * <p>Available filters:
33  * <ul>
34  * <li><B>ItfPatterns</B>: for filtering component interface MBeans.
35  * <li><B>MonitorStringPatterns</B>: for filtering
36  * {@link javax.management.monitor.StringMonitorMBean string monitor} MBeans.
37  * <li><B>MonitorCounterPatterns</B>: for filtering
38  * {@link javax.management.monitor.CounterMonitorMBean counter monitor} MBeans.
39  * <li><B>MonitorGaugePatterns</B>: for filtering
40  * {@link javax.management.monitor.GaugeMonitorMBean gauge monitor} MBeans.
41  * <li><B>MonitorPeriodicPatterns</B>: for filtering
42  * {@link javax.management.monitor.PeriodicMonitorMBean periodic monitor} MBeans.
43  * </ul>
44  *
45  * The syntax of these filters relies on the naming convention defined in {@link Admin}
46  * for component interfaces,
47  * except for some additional property-value pairs reserved for the configuration of JMX monitors.
48  *
49  *
50  * @version 0.1
51  */

52 public interface AdminAttributes extends AttributeController {
53     /*int getDepth ();
54     void setDepth (int depth);*/

55
56     /**
57      * Returns the patterns for filtering components interface MBeans.
58      *
59      * @return the patterns for filtering components interface MBeans.
60      *
61      * @see #setItfPatterns
62      */

63     String JavaDoc getItfPatterns();
64
65     /**
66      * Sets the patterns for filtering components interface MBeans.
67      * Any component interface, whose {@link javax.management.ObjectName ObjectName} matches one of these patterns,
68      * can be registered in the agent.
69      *
70      * <P>The syntax of this filter is defined to equal a sequence of (";" separated) string representations of
71      * {@link javax.management.ObjectName ObjectName} patterns.
72      * For example:
73      * <p><pre>
74      * *:itf=attribute-controller,*;&#42;/Foo/*:*
75      * </pre>
76      * represents two patterns that can match respectively:
77      * <UL>
78      * <LI>the attribute controller interface of any component.</LI>
79      * <LI>any server interface of any component, if a super-component (in the content hierarchy)
80      * of this component is named "Foo".</LI>
81      * </UL>
82      *
83      * @param str the patterns for filtering components interface MBeans.
84      */

85     void setItfPatterns(String JavaDoc str);
86
87     /**
88      * Returns the patterns for filtering {@link javax.management.monitor.StringMonitorMBean string monitor} MBeans.
89      *
90      * @return the patterns for filtering {@link javax.management.monitor.StringMonitorMBean string monitor} MBeans.
91      *
92      * @see #setMonitorStringPatterns
93      */

94     String JavaDoc getMonitorStringPatterns();
95
96     /**
97      * Sets the patterns for filtering {@link javax.management.monitor.StringMonitorMBean string monitor} MBeans.
98      * Any getter of type string, specified in a component interface whose
99      * {@link javax.management.ObjectName ObjectName} matches one of these patterns,
100      * can be observed by a {@link javax.management.monitor.StringMonitorMBean string monitor}.
101      *
102      * <P>The syntax of this filter is defined to equal a sequence of (";" separated) string representations of
103      * {@link javax.management.ObjectName ObjectName} patterns. Where the following properties are
104      * reserved for the configuration of a {@link javax.management.monitor.StringMonitorMBean string monitor}
105      * (as defined in the JMX specification):
106      * <p><UL>
107      * <LI><B>observedAttribute</B>: the attribute being observed.</LI>
108      * <LI><B>granularityPeriod</B>: the granularity period (in milliseconds).</LI>
109      * <LI><B>stringToCompare</B>: the string to compare with the observed attribute.</LI>
110      * <LI><B>notifyDiffer</B>: the differing notification's on/off switch value.</LI>
111      * <LI><B>notifyMatch</B>: the matching notification's on/off switch value.</LI>
112      * </UL>
113      *
114      * <p>For example:
115      * <p><pre>
116      * *:itf=attribute-controller,observedAttribute=Foo,granularityPeriod=5000,
117      * stringToCompare=fooval,notifyDiffer=true,notifyMatch=true,*
118      * </pre>
119      * represents a pattern that can match the attribute controller interface of any component,
120      * if this interface specifies a string attribute "Foo".
121      * This attribute will be monitored every 5000 ms and compared with the value "fooval".
122      * As defined in the JMX specification:
123      * <p><UL>
124      * <LI>A {@link javax.management.monitor.MonitorNotification#STRING_TO_COMPARE_VALUE_MATCHED match notification}
125      * is sent when the value of the attribute "Foo" first matches the value "fooval".
126      * Subsequent matchings of "fooval" do not cause further notifications unless the attribute value
127      * differs from "fooval".</LI>
128      * <LI>A {@link javax.management.monitor.MonitorNotification#STRING_TO_COMPARE_VALUE_DIFFERED differ notification}
129      * is sent when the value of the attribute "Foo" first differs from the value "fooval".
130      * Subsequent differences from "fooval" do not cause further notifications unless the attribute value
131      * matches "fooval".</LI>
132      * </UL>
133      *
134      *
135      * @param str the patterns for filtering {@link javax.management.monitor.StringMonitorMBean string monitor} MBeans.
136      */

137     void setMonitorStringPatterns(String JavaDoc str);
138
139     /**
140      * Returns the patterns for filtering {@link javax.management.monitor.CounterMonitorMBean counter monitor} MBeans.
141      *
142      * @return the patterns for filtering {@link javax.management.monitor.CounterMonitorMBean counter monitor} MBeans.
143      *
144      * @see #setMonitorCounterPatterns
145      */

146     String JavaDoc getMonitorCounterPatterns();
147
148     /**
149      * Sets the patterns for filtering {@link javax.management.monitor.CounterMonitorMBean counter monitor} MBeans.
150      * Any getter of type integer (Byte, Integer, Short, Long),
151      * specified in a component interface whose
152      * {@link javax.management.ObjectName ObjectName} matches one of these patterns,
153      * can be observed by a {@link javax.management.monitor.CounterMonitorMBean counter monitor}.
154      *
155      * <P>The syntax of this filter is defined to equal a sequence of (";" separated) string representations of
156      * {@link javax.management.ObjectName ObjectName} patterns. Where the following properties are
157      * reserved for the configuration of a {@link javax.management.monitor.CounterMonitorMBean counter monitor}
158      * (as defined in the JMX specification):
159      * <p><UL>
160      * <LI><B>observedAttribute</B>: the attribute being observed.</LI>
161      * <LI><B>granularityPeriod</B>: the granularity period (in milliseconds).</LI>
162      * <LI><B>initThreshold</B>: the initial threshold value.</LI>
163      * <LI><B>modulus</B>: the modulus value.</LI>
164      * <LI><B>offset</B>: the offset value.</LI>
165      * <LI><B>differenceMode</B>: the difference mode flag value.</LI>
166      * </UL>
167      *
168      * <p>For example:
169      * <p><pre>
170      * *:itf=stat-controller,observedAttribute=NumberOfMethodCall,granularityPeriod=5000,
171      * initThreshold=2,modulus=0,offset=10,differenceMode=false,*
172      * </pre>
173      * represents a pattern that can match the interface "stat-controller" of any component,
174      * if this interface specifies an integer attribute named "NumberOfMethodCall".
175      * This attribute will be monitored every 5000 ms.
176      * {@link javax.management.monitor.MonitorNotification#THRESHOLD_VALUE_EXCEEDED Threshold notifications}
177      * are sent, as defined in the JMX specification for a
178      * {@link javax.management.monitor.CounterMonitorMBean counter monitor} configured with:
179      * InitThreshold=2, Modulus=0, Offset=10 and DifferenceMode=false
180      * (by default Notify=true).
181      *
182      * @param str the patterns for filtering
183      * {@link javax.management.monitor.CounterMonitorMBean counter monitor} MBeans.
184      */

185     void setMonitorCounterPatterns(String JavaDoc str);
186
187     /**
188      * Returns the patterns for filtering
189      * {@link javax.management.monitor.GaugeMonitorMBean gauge monitor} MBeans.
190      *
191      * @return the patterns for filtering
192      * {@link javax.management.monitor.GaugeMonitorMBean gauge monitor} MBeans.
193      *
194      * @see #setMonitorGaugePatterns
195      */

196     String JavaDoc getMonitorGaugePatterns();
197
198     /**
199      * Sets the patterns for filtering
200      * {@link javax.management.monitor.GaugeMonitorMBean gauge monitor} MBeans.
201      * Any getter of type integer or floating-point (Byte, Integer, Short,
202      * Long, Float, Double), specified in a component interface whose
203      * {@link javax.management.ObjectName ObjectName} matches one of these patterns,
204      * can be observed by a {@link javax.management.monitor.GaugeMonitorMBean gauge monitor}.
205      *
206      * <P>The syntax of this filter is defined to equal a sequence of (";" separated) string representations of
207      * {@link javax.management.ObjectName ObjectName} patterns. Where the following properties are
208      * reserved for the configuration of a {@link javax.management.monitor.GaugeMonitorMBean gauge monitor}
209      * (as defined in the JMX specification):
210      * <p><UL>
211      * <LI><B>observedAttribute</B>: the attribute being observed.</LI>
212      * <LI><B>granularityPeriod</B>: the granularity period (in milliseconds).</LI>
213      * <LI><B>lowThreshold</B>: the low threshold value.</LI>
214      * <LI><B>highThreshold</B>: the low threshold value.</LI>
215      * <LI><B>differenceMode</B>: the difference mode flag value.</LI>
216      * </UL>
217      *
218      * <p>For example:
219      * <p><pre>
220      * *:itf=stat-controller,observedAttribute=RateOfMethodCall,granularityPeriod=5000,
221      * lowThreshold=0.05,highThreshold=0.15,differenceMode=false,*
222      * </pre>
223      * represents a pattern that can match the interface "stat-controller" of any component,
224      * if this interface specifies an integer or floating-point attribute named "RateOfMethodCall".
225      * This attribute will be monitored every 5000 ms.
226      * {@link javax.management.monitor.MonitorNotification#THRESHOLD_HIGH_VALUE_EXCEEDED Threshold high notifications}
227      * and
228      * {@link javax.management.monitor.MonitorNotification#THRESHOLD_LOW_VALUE_EXCEEDED Threshold low notifications}
229      * are sent, as defined in the JMX specification for a
230      * {@link javax.management.monitor.GaugeMonitorMBean gauge monitor} configured with:
231      * LowThreshold=0.05, HighThreshold=0.15 and DifferenceMode=false
232      * (by default NotifyHigh=true and NotifyLow=true).
233      * </UL>
234      *
235      *
236      * @param str the patterns for filtering
237      * {@link javax.management.monitor.GaugeMonitorMBean gauge monitor} MBeans.
238      */

239     void setMonitorGaugePatterns(String JavaDoc str);
240
241     /**
242      * Returns the patterns for filtering {@link javax.management.monitor.PeriodicMonitorMBean periodic monitor} MBeans.
243      *
244      * @return the patterns for filtering {@link javax.management.monitor.PeriodicMonitorMBean periodic monitor} MBeans.
245      *
246      * @see #setMonitorPeriodicPatterns
247      */

248     String JavaDoc getMonitorPeriodicPatterns();
249
250     /**
251      * Sets the patterns for filtering {@link javax.management.monitor.PeriodicMonitorMBean periodic monitor} MBeans.
252      * Any getter, specified in a component interface whose
253      * {@link javax.management.ObjectName ObjectName} matches one of these patterns,
254      * can be observed by a {@link javax.management.monitor.PeriodicMonitorMBean periodic monitor}.
255      *
256      * <P>The syntax of this filter is defined to equal a sequence of (";" separated) string representations of
257      * {@link javax.management.ObjectName ObjectName} patterns. Where the following properties are
258      * reserved for the configuration of a {@link javax.management.monitor.PeriodicMonitorMBean periodic monitor}:
259      * <p><UL>
260      * <LI><B>observedAttribute</B>: the attribute being observed.</LI>
261      * <LI><B>granularityPeriod</B>: the granularity period (in milliseconds).</LI>
262      * </UL>
263      *
264      * <p>For example:
265      * <p><pre>
266      * *:itf=attribute-controller,observedAttribute=Foo,granularityPeriod=5000
267      * </pre>
268      * represents a pattern that can match the attribute controller interface of any component,
269      * if this interface specifies a string attribute "Foo".
270      * Every 5000 ms, this attribute will be monitored and a notification will be sent.
271      *
272      *
273      * @param str the patterns for filtering {@link javax.management.monitor.PeriodicMonitorMBean periodic monitor} MBeans.
274      */

275     void setMonitorPeriodicPatterns(String JavaDoc str);
276
277     /**
278      * Returns the underlying {@link javax.management.monitor.MBeanServer MBeanServer} used by the agent.
279      *
280      * This method allows raw MBean manipulation on the Fractal JMX agent side.
281      *
282      * @return the underlying {@link javax.management.monitor.MBeanServer MBeanServer} used by the agent.
283      */

284     MBeanServer JavaDoc getRawMBeanServer();
285
286     /**
287      * Sets the underlying {@link javax.management.monitor.MBeanServer MBeanServer} used by the agent.
288      *
289      * <p>This method is unsupported, but specified since the Fractal
290      * {@link org.objectweb.fractal.api.control.AttributeController attribute controller}
291      * API requires getter and setter methods for each attribute.
292      *
293      * @param srv the underlying {@link javax.management.monitor.MBeanServer MBeanServer} used by the agent.
294      *
295      * @throws UnsupportedOperationException if this operation is not supported.
296      */

297     void setRawMBeanServer(MBeanServer JavaDoc srv) throws UnsupportedOperationException JavaDoc;
298 }
299
Popular Tags