Source Code Cross Referenced for JmxPoint.java in  » Profiler » JMeasurement » de » mcs » jmeasurement » jmx » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Profiler » JMeasurement » de.mcs.jmeasurement.jmx 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * MCS Media Computer Software Copyright (c) 2007 by MCS
003:         * -------------------------------------- Created on 11.01.2007 by W.Klaas
004:         * 
005:         * Licensed under the Apache License, Version 2.0 (the "License"); you may not
006:         * use this file except in compliance with the License. You may obtain a copy of
007:         * the License at
008:         * 
009:         * http://www.apache.org/licenses/LICENSE-2.0
010:         * 
011:         * Unless required by applicable law or agreed to in writing, software
012:         * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
013:         * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
014:         * License for the specific language governing permissions and limitations under
015:         * the License.
016:         */
017:        package de.mcs.jmeasurement.jmx;
018:
019:        import java.util.Date;
020:
021:        import de.mcs.jmeasurement.DefaultMeasurePoint;
022:        import de.mcs.jmeasurement.MeasureFactory;
023:        import de.mcs.jmeasurement.MeasurePoint;
024:
025:        /**
026:         * Proxy class for accessing the real measure point data. Because of the
027:         * autosaving feature we needed to determine the real measure point instance for
028:         * every data access. So we only save the point name in this class and get the
029:         * point by using <code>MeasureFactory.getMeasurePoint(pointName)</code>
030:         * method.
031:         * 
032:         * @author W.Klaas
033:         * 
034:         */
035:        public class JmxPoint {
036:
037:            /** name of the point to use. */
038:            private String pointName;
039:
040:            /**
041:             * Constructor of this proxy class. Only the name will be delivered.
042:             * 
043:             * @param name
044:             *            name of the point to use.
045:             */
046:            public JmxPoint(final String name) {
047:                this .pointName = name;
048:            }
049:
050:            /**
051:             * getting the name of the point.
052:             * 
053:             * @return name
054:             */
055:            public final String getName() {
056:                return pointName;
057:            }
058:
059:            /**
060:             * dynamic access to the measure point.
061:             * 
062:             * @return MeasurePoint.
063:             */
064:            private MeasurePoint getPoint() {
065:                return MeasureFactory.getMeasurePoint(pointName);
066:            }
067:
068:            /**
069:             * @return the avverafe msec of all monitors of this measure point.
070:             */
071:            public final long getAverageMSec() {
072:                try {
073:                    return getPoint().getData(
074:                            DefaultMeasurePoint.DATA_KEY_AVERAGE_MSEC)
075:                            .getAsLong();
076:                } catch (Exception e) {
077:                    e.printStackTrace();
078:                }
079:                return 0;
080:            }
081:
082:            /**
083:             * @return the minimum msec of a monitor of this measure point.
084:             */
085:            public final long getMinMSec() {
086:                try {
087:                    return getPoint().getData(
088:                            DefaultMeasurePoint.DATA_KEY_MIN_MSEC).getAsLong();
089:                } catch (Exception e) {
090:                    e.printStackTrace();
091:                }
092:                return 0;
093:            }
094:
095:            /**
096:             * @return the maximum msec of a monitor of this measure point.
097:             */
098:            public final long getMaxMSec() {
099:                try {
100:                    return getPoint().getData(
101:                            DefaultMeasurePoint.DATA_KEY_MAX_MSEC).getAsLong();
102:                } catch (Exception e) {
103:                    e.printStackTrace();
104:                }
105:                return 0;
106:            }
107:
108:            /**
109:             * @return the count of exception of this measure point.
110:             */
111:            public final String getExceptionList() {
112:                try {
113:                    return getPoint().getData(
114:                            DefaultMeasurePoint.DATA_KEY_EXCEPTION_LIST)
115:                            .getAsString();
116:                } catch (Exception e) {
117:                    e.printStackTrace();
118:                }
119:                return "";
120:            }
121:
122:            /**
123:             * @return the count of exception of this measure point.
124:             */
125:            public final long getExceptionCount() {
126:                try {
127:                    return getPoint().getData(
128:                            DefaultMeasurePoint.DATA_KEY_EXCEPTION_COUNT)
129:                            .getAsLong();
130:                } catch (Exception e) {
131:                    e.printStackTrace();
132:                }
133:                return 0;
134:            }
135:
136:            /**
137:             * @return the last activation of this measure point.
138:             */
139:            public final Date getLastActivation() {
140:                try {
141:                    return getPoint().getData(
142:                            DefaultMeasurePoint.DATA_KEY_LAST_ACTIVATION)
143:                            .getAsDate();
144:                } catch (Exception e) {
145:                    e.printStackTrace();
146:                }
147:                return new Date(0);
148:            }
149:
150:            /**
151:             * @return the count of death monitors of this measure point.
152:             */
153:            public final long getDeathCount() {
154:                try {
155:                    return getPoint().getData(
156:                            DefaultMeasurePoint.DATA_KEY_DEATH_COUNT)
157:                            .getAsLong();
158:                } catch (Exception e) {
159:                    e.printStackTrace();
160:                }
161:                return 0;
162:            }
163:
164:            /**
165:             * @return the maximum active monitors of this measure point.
166:             */
167:            public final long getMaxActive() {
168:                try {
169:                    return getPoint().getData(
170:                            DefaultMeasurePoint.DATA_KEY_MAX_ACTIVE)
171:                            .getAsLong();
172:                } catch (Exception e) {
173:                    e.printStackTrace();
174:                }
175:                return 0;
176:            }
177:
178:            /**
179:             * @return the active monitors of this measure point.
180:             */
181:            public final long getActive() {
182:                try {
183:                    return getPoint().getData(
184:                            DefaultMeasurePoint.DATA_KEY_ACTIVE).getAsLong();
185:                } catch (Exception e) {
186:                    e.printStackTrace();
187:                }
188:                return 0;
189:            }
190:
191:            /**
192:             * @return the total milli seconds of this measure point.
193:             */
194:            public final long getTotalMSec() {
195:                try {
196:                    return getPoint().getData(
197:                            DefaultMeasurePoint.DATA_KEY_TOTAL_MSEC)
198:                            .getAsLong();
199:                } catch (Exception e) {
200:                    e.printStackTrace();
201:                }
202:                return -1;
203:            }
204:
205:            /**
206:             * @return the deviation of this measure point.
207:             */
208:            public final Float getDeviation() {
209:                try {
210:                    return (Float) getPoint().getData(
211:                            DefaultMeasurePoint.DATA_KEY_DEVIATION).getValue();
212:                } catch (Exception e) {
213:                    e.printStackTrace();
214:                }
215:                return new Float(0.0);
216:            }
217:
218:            /**
219:             * @return the access count of this measure point.
220:             */
221:            public final long getAccessCount() {
222:                try {
223:                    return getPoint().getData(
224:                            DefaultMeasurePoint.DATA_KEY_ACCESS_COUNT)
225:                            .getAsLong();
226:                } catch (Exception e) {
227:                    e.printStackTrace();
228:                }
229:                return -1;
230:            }
231:
232:            /**
233:             * @return the priority of this measure point.
234:             */
235:            public final int getPriority() {
236:                try {
237:                    return getPoint().getData(
238:                            DefaultMeasurePoint.DATA_KEY_PRIORITY).getAsInt();
239:                } catch (Exception e) {
240:                    e.printStackTrace();
241:                }
242:                return -1;
243:            }
244:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.