01: /*
02: * Copyright (C) The MX4J Contributors.
03: * All rights reserved.
04: *
05: * This software is distributed under the terms of the MX4J License version 1.0.
06: * See the terms of the MX4J License in the documentation provided with this software.
07: */
08:
09: package test.javax.management.modelmbean.support;
10:
11: import java.util.ArrayList;
12: import java.util.List;
13:
14: import test.MutableInteger;
15:
16: /**
17: * @version $Revision: 1.3 $
18: * @see
19: */
20: public class ModelMBeanTarget {
21: private MutableInteger m_counter;
22: private String m_content;
23: private int m_value;
24: private String[] m_array;
25:
26: public ModelMBeanTarget(MutableInteger integer) {
27: m_counter = integer;
28: }
29:
30: public String getFixedContent() {
31: m_counter.set(m_counter.get() + 1);
32: return "FIXED_CONTENT";
33: }
34:
35: public String getMutableContent() {
36: return m_content;
37: }
38:
39: public void setMutableContent(String content) {
40: m_content = content;
41: }
42:
43: public int getMutableContent2() {
44: return m_value;
45: }
46:
47: public void setMutableContent2(int value) {
48: m_value = value;
49: }
50:
51: public String[] getArrayAttribute() {
52: return m_array;
53: }
54:
55: public void setArrayAttribute(String[] array) {
56: m_array = array;
57: }
58:
59: public List operation1(char c, short s, float[] f, Object[][] obj) {
60: m_counter.set(m_counter.get() + 1);
61: ArrayList list = new ArrayList();
62: Character ch = new Character(c);
63: Short sh = new Short(s);
64: list.add(ch);
65: list.add(sh);
66: list.add(f);
67: list.add(obj);
68: return list;
69: }
70:
71: public static class TargetBean {
72: public List operation1(char c, short s, float[] f,
73: Object[][] obj) {
74: // Add in reverse order
75: ArrayList list = new ArrayList();
76: Character ch = new Character(c);
77: Short sh = new Short(s);
78: list.add(obj);
79: list.add(f);
80: list.add(sh);
81: list.add(ch);
82: return list;
83: }
84: }
85: }
|