Source Code Cross Referenced for JmxConfig.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 09.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.io.File;
020:        import java.io.FileWriter;
021:        import java.io.IOException;
022:        import java.io.Writer;
023:
024:        import org.xml.sax.SAXException;
025:
026:        import de.mcs.jmeasurement.JMConfig;
027:        import de.mcs.jmeasurement.MeasureFactory;
028:        import de.mcs.jmeasurement.RendererMustNotBeNullException;
029:        import de.mcs.jmeasurement.renderer.DefaultHTMLRenderer;
030:
031:        /**
032:         * The MBean implementation for the configuration. To register this JMX
033:         * Extension, you can use the
034:         * {@link de.mcs.jmeasurement.MeasureFactory#registerMBeans()} method, so the
035:         * MBeans will be registered in the standard MBean server deployed with the JRE.
036:         * 
037:         * @author W.Klaas
038:         * 
039:         */
040:        public class JmxConfig implements  JmxConfigMBean {
041:
042:            /**
043:             * @return the backgroundTime
044:             */
045:            public final int getBackgroundTime() {
046:                return MeasureFactory.getConfig().getInteger(
047:                        JMConfig.OPTION_BACKGROUND_TIME);
048:            }
049:
050:            /**
051:             * @param backgroundTime
052:             *            the backgroundTime to set
053:             */
054:            public final void setBackgroundTime(final int backgroundTime) {
055:                MeasureFactory.getConfig().setInteger(
056:                        JMConfig.OPTION_BACKGROUND_TIME, backgroundTime);
057:            }
058:
059:            /**
060:             * @return the configAutofile
061:             */
062:            public final boolean isConfigAutofile() {
063:                return MeasureFactory.getConfig().getBoolean(
064:                        JMConfig.OPTION_CONFIG_AUTOFILE);
065:            }
066:
067:            /**
068:             * @param configAutofile
069:             *            the configAutofile to set
070:             */
071:            public final void setConfigAutofile(final boolean configAutofile) {
072:                MeasureFactory.getConfig().setBoolean(
073:                        JMConfig.OPTION_CONFIG_AUTOFILE, configAutofile);
074:            }
075:
076:            /**
077:             * @return the disableDeviation
078:             */
079:            public final boolean isDisableDeviation() {
080:                return MeasureFactory.getConfig().getBoolean(
081:                        JMConfig.OPTION_DISABLE_DEVIATION);
082:
083:            }
084:
085:            /**
086:             * @param disableDeviation
087:             *            the disableDeviation to set
088:             */
089:            public final void setDisableDeviation(final boolean disableDeviation) {
090:                MeasureFactory.getConfig().setBoolean(
091:                        JMConfig.OPTION_DISABLE_DEVIATION, disableDeviation);
092:            }
093:
094:            /**
095:             * @return the enableAutosnapshot
096:             */
097:            public final boolean isEnableAutosnapshot() {
098:                return MeasureFactory.getConfig().getBoolean(
099:                        JMConfig.OPTION_ENABLE_AUTOSNAPSHOT);
100:
101:            }
102:
103:            /**
104:             * @param enableAutosnapshot
105:             *            the enableAutosnapshot to set
106:             */
107:            public final void setEnableAutosnapshot(
108:                    final boolean enableAutosnapshot) {
109:                MeasureFactory.getConfig()
110:                        .setBoolean(JMConfig.OPTION_ENABLE_AUTOSNAPSHOT,
111:                                enableAutosnapshot);
112:            }
113:
114:            /**
115:             * @return the enableMeasurement
116:             */
117:            public final boolean isEnableMeasurement() {
118:                return MeasureFactory.getConfig().getBoolean(
119:                        JMConfig.OPTION_ENABLE_MEASUREMENT);
120:
121:            }
122:
123:            /**
124:             * @param enableMeasurement
125:             *            the enableMeasurement to set
126:             */
127:            public final void setEnableMeasurement(
128:                    final boolean enableMeasurement) {
129:                MeasureFactory.getConfig().setBoolean(
130:                        JMConfig.OPTION_ENABLE_MEASUREMENT, enableMeasurement);
131:            }
132:
133:            /**
134:             * @return the enableMemorySavings
135:             */
136:            public final boolean isEnableMemorySavings() {
137:                return MeasureFactory.getConfig().getBoolean(
138:                        JMConfig.OPTION_ENABLE_MEMORY_SAVINGS);
139:
140:            }
141:
142:            /**
143:             * @param enableMemorySavings
144:             *            the enableMemorySavings to set
145:             */
146:            public final void setEnableMemorySavings(
147:                    final boolean enableMemorySavings) {
148:                MeasureFactory.getConfig().setBoolean(
149:                        JMConfig.OPTION_ENABLE_MEMORY_SAVINGS,
150:                        enableMemorySavings);
151:            }
152:
153:            /**
154:             * @return the exceptionHandling
155:             */
156:            public final int getExceptionHandling() {
157:                return MeasureFactory.getConfig().getInteger(
158:                        JMConfig.OPTION_EXCEPTION_HANDLING);
159:
160:            }
161:
162:            /**
163:             * @param exceptionHandling
164:             *            the exceptionHandling to set
165:             */
166:            public final void setExceptionHandling(final int exceptionHandling) {
167:                MeasureFactory.getConfig().setInteger(
168:                        JMConfig.OPTION_EXCEPTION_HANDLING, exceptionHandling);
169:            }
170:
171:            /**
172:             * @return the pointIdletime
173:             */
174:            public final int getPointIdletime() {
175:                return MeasureFactory.getConfig().getInteger(
176:                        JMConfig.OPTION_POINT_IDLETIME);
177:            }
178:
179:            /**
180:             * @param pointIdletime
181:             *            the pointIdletime to set
182:             */
183:            public final void setPointIdletime(final int pointIdletime) {
184:                MeasureFactory.getConfig().setInteger(
185:                        JMConfig.OPTION_POINT_IDLETIME, pointIdletime);
186:            }
187:
188:            /**
189:             * @return the workingpath
190:             */
191:            public final String getWorkingpath() {
192:                return MeasureFactory.getConfig().getProperty(
193:                        JMConfig.OPTION_WORKINGPATH);
194:            }
195:
196:            /**
197:             * @param workingpath
198:             *            the workingpath to set
199:             */
200:            public final void setWorkingpath(final String workingpath) {
201:                MeasureFactory.getConfig().setProperty(
202:                        JMConfig.OPTION_WORKINGPATH, workingpath);
203:            }
204:
205:            /**
206:             * @return String array with all snapshotnames.
207:             */
208:            public final String[] getSnapShotNames() {
209:                return MeasureFactory.getSnapShotNames();
210:            }
211:
212:            /**
213:             * taking a new shapshot with the given name.
214:             * 
215:             * @param name
216:             *            name of the snapshot.
217:             */
218:            public final void takeSnapShot(final String name) {
219:                MeasureFactory.takeSnapshot(name);
220:            }
221:
222:            /**
223:             * @param name
224:             *            name of the snapshot
225:             * @param filename
226:             *            save the snapshot to the desired filename.
227:             * @throws IOException
228:             *             if someting goes wrong.
229:             * @throws SAXException
230:             *             if someting goes wrong.
231:             */
232:            public final void saveSnapShot(final String name,
233:                    final String filename) throws SAXException, IOException {
234:                MeasureFactory.saveSnapShot(MeasureFactory.getSnapShot(name),
235:                        new File(filename));
236:            }
237:
238:            /**
239:             * @param filename
240:             *            save the html report to the desired filename.
241:             * @throws IOException
242:             *             if someting goes wrong.
243:             */
244:            public final void saveHTMLReport(final String filename)
245:                    throws IOException {
246:                try {
247:                    Writer writer = new FileWriter(filename);
248:                    MeasureFactory.getReport(null, new DefaultHTMLRenderer(),
249:                            writer);
250:                    writer.close();
251:                } catch (RendererMustNotBeNullException e) {
252:                    e.printStackTrace();
253:                }
254:            }
255:
256:            /**
257:             * @return the actual application name.
258:             */
259:            public final String getApplicationName() {
260:                return MeasureFactory.getApplicationName();
261:            }
262:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.