01: /* JFox, the OpenSource J2EE Application Server
02: *
03: * Copyright (C) 2002 huihoo.org
04: * Distributable under GNU LGPL license
05: * See the GNU Lesser General Public License for more details.
06: */
07:
08: package example.jmx.standard;
09:
10: /**
11: *
12: * @author <a href="mailto:young_yy@hotmail.org">Young Yang</a>
13: */
14:
15: public class SimpleStandard implements SimpleStandardMBean {
16: private String state = "initial state";
17: private int nbChanges = 0;
18:
19: private int nbResets = 0;
20:
21: private float floating = 0.0f;
22:
23: private int count = 0;
24:
25: public String getState() {
26: return state;
27: }
28:
29: public void setState(String s) {
30: state = s;
31: // System.out.println("[" + this.toString() + "] state field have changed to: " + s );
32: nbChanges++;
33: }
34:
35: public Integer getNbChanges() {
36: return new Integer(nbChanges);
37: }
38:
39: public void reset() {
40: state = "initial state";
41: nbChanges = 0;
42: nbResets++;
43: }
44:
45: public Integer getNbResets() {
46: return new Integer(nbResets);
47: }
48:
49: public int deploy(String name, int i) {
50: System.out.println("deploy " + name + ", " + i);
51: return 0;
52: }
53:
54: public int withdraw(String name, int i, int t) {
55: System.out.println("withdraw " + name + ", " + i + ", " + t);
56: return 0;
57: }
58:
59: public float getFloating() {
60: return floating;
61: }
62:
63: public void setFloating(float floating) {
64: this .floating = floating;
65: }
66:
67: public int getCount() {
68: return count;
69: }
70:
71: public void setCount(int count) {
72: this.count = count;
73: }
74:
75: }
|