01: /*
02: * MCS Media Computer Software Copyright (c) 2007 by MCS
03: * -------------------------------------- Created on 10.01.2007 by W.Klaas
04: *
05: * Licensed under the Apache License, Version 2.0 (the "License"); you may not
06: * use this file except in compliance with the License. You may obtain a copy of
07: * the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13: * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14: * License for the specific language governing permissions and limitations under
15: * the License.
16: */
17: package de.mcs.jmeasurement.jmx;
18:
19: import java.util.HashMap;
20: import java.util.Map;
21:
22: import de.mcs.jmeasurement.MeasureFactory;
23: import de.mcs.jmeasurement.MeasurePoint;
24:
25: /**
26: * This class is the implementation of the JMX points bean. Here we deliver all
27: * measure points as tabular data (Map)
28: *
29: * @author W.Klaas
30: *
31: */
32: public class JmxPointsImpl implements JmxPointsMXBean {
33:
34: /**
35: * Getting all measure points as map with key = name of the point (String)
36: * and the value is the proxy class JmxPoint for accessing the real
37: * MeasurePoint class.
38: *
39: * @return map
40: */
41: public final Map<String, JmxPoint> getPoints() {
42: MeasurePoint[] points = MeasureFactory.getMeasurePoints(null);
43: HashMap<String, JmxPoint> hmData = new HashMap<String, JmxPoint>();
44: for (int i = 0; i < points.length; i++) {
45: hmData.put(points[i].getName(), new JmxPoint(points[i]
46: .getName()));
47: }
48: return hmData;
49: }
50: }
|