User: d_jencks
Date: 02/02/28 10:00:32
Modified: src/main/test/implementation/modelmbean/support User.java
Log:
changed to use new xmbean dtd, and provided User.xml sample generated from xdoclet
jboss xmbean task (available in xdoclet 1.1.2)
Revision Changes Path
1.2 +146 -23 jmx/src/main/test/implementation/modelmbean/support/User.java
Index: User.java
===================================================================
RCS file:
/cvsroot/jboss/jmx/src/main/test/implementation/modelmbean/support/User.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- User.java 21 Feb 2002 06:46:20 -0000 1.1
+++ User.java 28 Feb 2002 18:00:32 -0000 1.2
@@ -1,6 +1,26 @@
package test.implementation.modelmbean.support;
-
+/**
+ * @jmx:mbean description="sample for jboss xmbean.dtd"
+ * persistPolicy="Never"
+ * persistPeriod="10"
+ * persistLocation="pl1"
+ * persistName="JBossXMLExample1"
+ * currencyTimeLimit="10"
+ * descriptor="name=\"testdescriptor\" value=\"testvalue\""
+ * state-action-on-update="RESTART"
+ *
+ *
+ * @jmx:notification description="first notification"
+ * name="javax.management.SomeEvent"
+ * notificationType="xd.example.first,xd.example.second"
+ * persistPolicy="Never"
+ * persistPeriod="20"
+ * persistLocation="pl2"
+ * persistName="JBossXMLExample2"
+ * currencyTimeLimit="20"
+ *
+ **/
public class User {
private long id = System.currentTimeMillis();
@@ -9,57 +29,148 @@
private String password = null;
private String[] numbers = new String[3];
-
- // read-only attribute 'ID'
- public long getID() {
+ /**
+ * Creates a new <code>User</code> instance using constructor with one argument.
+ *
+ * @param id a <code>long</code> value
+ * @jmx:managed-constructor
+ */
+ public User(long id)
+ {
+ this.id = id;
+ }
+
+ /**
+ * Creates a new <code>User</code> using constructor with no argument
+ * @jmx:managed-constructor
+ *
+ */
+ public User()
+ {
+ }
+
+
+ /**
+ * Describe <code>getID</code> method here.
+ * read-only attribute
+ * @return a <code>long</code> value
+ * @jmx:managed-attribute persistPolicy="Never"
+ * persistPeriod="30"
+ * currencyTimeLimit="30"
+ */
+ public long getID() {
return id;
}
- // application method, not exposed to management
- public void setID(long id) {
+
+ /**
+ * Describe <code>setID</code> method here.
+ * application method, not exposed to management
+ *
+ * @param id a <code>long</code> value
+ */
+ public void setID(long id) {
this.id = id;
}
- // read-write attribute 'Name'
- public String getName() {
+
+ /**
+ * Describe <code>getName</code> method here.
+ * read-write attribute
+ * @return a <code>String</code> value
+ * @jmx:managed-attribute persistPolicy="Never"
+ * persistPeriod="30"
+ * currencyTimeLimit="30"
+ */
+ public String getName() {
return name;
}
- public void setName(String name) {
+ /**
+ * Describe <code>setName</code> method here.
+ *
+ * @param name a <code>String</code> value
+ * @jmx:managed-attribute
+ */
+ public void setName(String name) {
-//System.out.println("SetNAME");
+ //System.out.println("SetNAME");
- this.name = name;
- }
+ this.name = name;
+ }
- // read-write attribute 'Address'
- public String getAddress() {
+
+ /**
+ * Describe <code>getAddress</code> method here.
+ * read-write attribute
+ * @return a <code>String</code> value
+ * @jmx:managed-attribute persistPolicy="Never"
+ * persistPeriod="30"
+ * currencyTimeLimit="30"
+ */
+ public String getAddress() {
return address;
}
- public void setAddress(String address) {
+
+ /**
+ * Describe <code>setAddress</code> method here.
+ *
+ * @param address a <code>String</code> value
+ * @jmx:managed-attribute
+ */
+ public void setAddress(String address) {
this.address = address;
}
- // read-write array attribute 'PhoneNumbers'
- public String[] getPhoneNumbers() {
+
+ /**
+ * Describe <code>getPhoneNumbers</code> method here.
+ * read-write attribute
+ * @return a <code>String[]</code> value
+ * @jmx:managed-attribute persistPolicy="Never"
+ * persistPeriod="30"
+ * currencyTimeLimit="30"
+ */
+ public String[] getPhoneNumbers() {
return numbers;
}
- public void setPhoneNumbers(String[] numbers) {
+ /**
+ * Describe <code>setPhoneNumbers</code> method here.
+ *
+ * @param numbers a <code>String[]</code> value
+ * @jmx:managed-attribute
+ */
+ public void setPhoneNumbers(String[] numbers) {
this.numbers = numbers;
}
- // write-only attribute 'Password'
- public void setPassword(String passwd) {
+
+ /**
+ * Describe <code>setPassword</code> method here.
+ * write only attribute
+ * @param passwd a <code>String</code> value
+ * @jmx:managed-attribute persistPolicy="Never"
+ * persistPeriod="30"
+ * currencyTimeLimit="30"
+ */
+ public void setPassword(String passwd) {
this.password = passwd;
}
// management operations
- public String printInfo() {
+
+ /**
+ * Describe <code>printInfo</code> method here.
+ * prints info
+ * @return a <code>String</code> value
+ * @jmx:managed-operation
+ */
+ public String printInfo() {
return
"User: " + getName() +"\n"+
"Address: " + getAddress() +"\n"+
@@ -68,7 +179,13 @@
"Phone #: " + getPhoneNumbers()[2] +"\n";
}
- public void addPhoneNumber(String number) {
+ /**
+ * Describe <code>addPhoneNumber</code> method here.
+ *
+ * @param number a <code>String</code> value, the phone number to add
+ * @jmx:managed-operation
+ */
+ public void addPhoneNumber(String number) {
for (int i = 0; i < numbers.length; ++i)
if (numbers[i] == null) {
numbers[i] = number;
@@ -76,7 +193,13 @@
}
}
- public void removePhoneNumber(int index) {
+ /**
+ * Describe <code>removePhoneNumber</code> method here.
+ *
+ * @param index an <code>int</code> value, the index of phone number to remove
+ * @jmx:managed-operation
+ */
+ public void removePhoneNumber(int index) {
if (index < 0 || index >= numbers.length)
return;
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development