KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > test > compliance > monitor > support > GaugeSupport


1 /*
2  * JBoss, the OpenSource J2EE webOS
3  *
4  * Distributable under LGPL license.
5  * See terms of license at gnu.org.
6  */

7
8 package test.compliance.monitor.support;
9
10 public class GaugeSupport
11   extends MonitorSupport
12   implements GaugeSupportMBean
13 {
14   private Number value;
15
16   public Number getValue()
17   {
18      unlock("get");
19      lock("get");
20      return value;
21   }
22
23   public void setValue(Number value)
24   {
25      this.value = value;
26   }
27
28   public Number getWrongNull()
29   {
30     return null;
31   }
32
33   public String getWrongType()
34   {
35     return "Wrong";
36   }
37
38   public Number getWrongException()
39   {
40      throw new RuntimeException("It is broke");
41   }
42   public void setWriteOnly(Number value)
43   {
44   }
45 }
46
Popular Tags