KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > example > Basic


1 package example;
2
3 /**
4  * Implements a resource which is a plain-old bean, which exposes
5  * the <code>getData()</code> method as a JMX-managed attribute.
6  */

7 public class Basic implements BasicMBean {
8   /**
9    * The sample data param.
10    */

11   private String JavaDoc _data = "default";
12
13   /**
14    * Sets the value.
15    */

16   public void setData(String JavaDoc data)
17   {
18     _data = data;
19   }
20
21   /**
22    * Gets the value.
23    */

24   public String JavaDoc getData()
25   {
26     return _data;
27   }
28
29   /**
30    * Returns a printable version of the resource.
31    */

32   public String JavaDoc toString()
33   {
34     return "Basic[" + _data + "]";
35   }
36 }
37
Popular Tags