Source Code Cross Referenced for DataCollectionNames.java in  » Database-JDBC-Connection-Pool » sequoia-2.10.9 » org » continuent » sequoia » common » jmx » monitoring » 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 » Database JDBC Connection Pool » sequoia 2.10.9 » org.continuent.sequoia.common.jmx.monitoring 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         * Sequoia: Database clustering technology.
003:         * Copyright (C) 2002-2004 French National Institute For Research In Computer
004:         * Science And Control (INRIA).
005:         * Copyright (C) 2005 AmicoSoft, Inc. dba Emic Networks
006:         * Contact: sequoia@continuent.org
007:         * 
008:         * Licensed under the Apache License, Version 2.0 (the "License");
009:         * you may not use this file except in compliance with the License.
010:         * You may obtain a copy of the License at
011:         * 
012:         * http://www.apache.org/licenses/LICENSE-2.0
013:         * 
014:         * Unless required by applicable law or agreed to in writing, software
015:         * distributed under the License is distributed on an "AS IS" BASIS,
016:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
017:         * See the License for the specific language governing permissions and
018:         * limitations under the License. 
019:         *
020:         * Initial developer(s): Nicolas Modrzyk.
021:         * Contributor(s): Emmanuel Cecchet.
022:         */package org.continuent.sequoia.common.jmx.monitoring;
023:
024:        import org.continuent.sequoia.common.i18n.Translate;
025:
026:        /**
027:         * Name convertions for data collection types.
028:         * 
029:         * @author <a href="mailto:Nicolas.Modrzyk@inrialpes.fr">Nicolas Modrzyk </a>
030:         * @author <a href="mailto:emmanuel.cecchet@emicnetworks.com">Emmanuel Cecchet
031:         *         </a>
032:         */
033:        public final class DataCollectionNames {
034:            /**
035:             * Convert the type reference of a collector into a <code>String</code>
036:             * 
037:             * @param dataType see DataCollection
038:             * @return a <code>String</code> that describes the collector
039:             */
040:            public static String get(int dataType) {
041:                switch (dataType) {
042:                /*
043:                 * Controller Collectors
044:                 */
045:                case DataCollection.CONTROLLER_TOTAL_MEMORY:
046:                    return Translate.get("monitoring.controller.total.memory"); //$NON-NLS-1$
047:                case DataCollection.CONTROLLER_USED_MEMORY:
048:                    return Translate.get("monitoring.controller.used.memory"); //$NON-NLS-1$
049:                case DataCollection.CONTROLLER_WORKER_PENDING_QUEUE:
050:                    return Translate.get("monitoring.controller.pending.queue"); //$NON-NLS-1$
051:                case DataCollection.CONTROLLER_THREADS_NUMBER:
052:                    return Translate
053:                            .get("monitoring.controller.threads.number"); //$NON-NLS-1$
054:                case DataCollection.CONTROLLER_IDLE_WORKER_THREADS:
055:                    return Translate
056:                            .get("monitoring.controller.idle.worker.threads"); //$NON-NLS-1$
057:                    /*
058:                     * Backend collectors
059:                     */
060:                case DataCollection.BACKEND_ACTIVE_TRANSACTION:
061:                    return Translate
062:                            .get("monitoring.backend.active.transactions"); //$NON-NLS-1$
063:                case DataCollection.BACKEND_PENDING_REQUESTS:
064:                    return Translate.get("monitoring.backend.pending.requests"); //$NON-NLS-1$
065:                case DataCollection.BACKEND_TOTAL_ACTIVE_CONNECTIONS:
066:                    return Translate
067:                            .get("monitoring.backend.active.connections"); //$NON-NLS-1$
068:                case DataCollection.BACKEND_TOTAL_REQUEST:
069:                    return Translate.get("monitoring.backend.total.requests"); //$NON-NLS-1$
070:                case DataCollection.BACKEND_TOTAL_READ_REQUEST:
071:                    return Translate
072:                            .get("monitoring.backend.total.read.requests"); //$NON-NLS-1$
073:                case DataCollection.BACKEND_TOTAL_WRITE_REQUEST:
074:                    return Translate
075:                            .get("monitoring.backend.total.write.requests"); //$NON-NLS-1$
076:                case DataCollection.BACKEND_TOTAL_TRANSACTIONS:
077:                    return Translate
078:                            .get("monitoring.backend.total.transactions"); //$NON-NLS-1$
079:                    /*
080:                     * VirtualDatabase collectors
081:                     */
082:                case DataCollection.DATABASES_ACTIVE_THREADS:
083:                    return Translate
084:                            .get("monitoring.virtualdatabase.active.threads"); //$NON-NLS-1$
085:                case DataCollection.DATABASES_PENDING_CONNECTIONS:
086:                    return Translate
087:                            .get("monitoring.virtualdatabase.pending.connections"); //$NON-NLS-1$
088:                case DataCollection.DATABASES_NUMBER_OF_THREADS:
089:                    return Translate
090:                            .get("monitoring.virtualdatabase.threads.count"); //$NON-NLS-1$
091:                    /*
092:                     * Cache stats collectors
093:                     */
094:                case DataCollection.CACHE_STATS_COUNT_HITS:
095:                    return Translate.get("monitoring.cache.count.hits"); //$NON-NLS-1$
096:                case DataCollection.CACHE_STATS_COUNT_INSERT:
097:                    return Translate.get("monitoring.cache.count.insert"); //$NON-NLS-1$
098:                case DataCollection.CACHE_STATS_COUNT_SELECT:
099:                    return Translate.get("monitoring.cache.count.select"); //$NON-NLS-1$
100:                case DataCollection.CACHE_STATS_HITS_PERCENTAGE:
101:                    return Translate.get("monitoring.cache.hits.ratio"); //$NON-NLS-1$
102:                case DataCollection.CACHE_STATS_NUMBER_ENTRIES:
103:                    return Translate.get("monitoring.cache.number.entries"); //$NON-NLS-1$
104:                    /*
105:                     * Scheduler collectors
106:                     */
107:                case DataCollection.SCHEDULER_NUMBER_READ:
108:                    return Translate.get("monitoring.scheduler.number.read"); //$NON-NLS-1$
109:                case DataCollection.SCHEDULER_NUMBER_REQUESTS:
110:                    return Translate
111:                            .get("monitoring.scheduler.number.requests"); //$NON-NLS-1$
112:                case DataCollection.SCHEDULER_NUMBER_WRITES:
113:                    return Translate.get("monitoring.scheduler.number.writes"); //$NON-NLS-1$
114:                case DataCollection.SCHEDULER_PENDING_TRANSACTIONS:
115:                    return Translate
116:                            .get("monitoring.scheduler.pending.transactions"); //$NON-NLS-1$
117:                case DataCollection.SCHEDULER_PENDING_WRITES:
118:                    return Translate.get("monitoring.scheduler.pending.writes"); //$NON-NLS-1$
119:                    /*
120:                     * Client collectors
121:                     */
122:                case DataCollection.CLIENT_TIME_ACTIVE:
123:                    return Translate.get("monitoring.client.active.time"); //$NON-NLS-1$
124:
125:                    /*
126:                     * Unknown collector
127:                     */
128:                default:
129:                    return "";
130:                }
131:            }
132:
133:            /**
134:             * Return the type of the collector corresponding to the command
135:             * 
136:             * @param command to get type form
137:             * @return an <code>int</code>
138:             */
139:            public static int getTypeFromCommand(String command) {
140:                command = command.replace('_', ' ');
141:                /*
142:                 * Controller Collectors
143:                 */
144:                if (command.equalsIgnoreCase(Translate
145:                        .get("monitoring.controller.total.memory"))) //$NON-NLS-1$
146:                    return DataCollection.CONTROLLER_TOTAL_MEMORY;
147:                else if (command.equalsIgnoreCase(Translate
148:                        .get("monitoring.controller.used.memory"))) //$NON-NLS-1$
149:                    return DataCollection.CONTROLLER_USED_MEMORY;
150:                else if (command.equalsIgnoreCase(Translate
151:                        .get("monitoring.controller.pending.queue"))) //$NON-NLS-1$
152:                    return DataCollection.CONTROLLER_WORKER_PENDING_QUEUE;
153:                else if (command.equalsIgnoreCase(Translate
154:                        .get("monitoring.controller.threads.number"))) //$NON-NLS-1$
155:                    return DataCollection.CONTROLLER_THREADS_NUMBER;
156:                else if (command.equalsIgnoreCase(Translate
157:                        .get("monitoring.controller.idle.worker.threads"))) //$NON-NLS-1$
158:                    return DataCollection.CONTROLLER_IDLE_WORKER_THREADS;
159:
160:                /*
161:                 * Backend collectors
162:                 */
163:                else if (command.equalsIgnoreCase(Translate
164:                        .get("monitoring.backend.active.transactions"))) //$NON-NLS-1$
165:                    return DataCollection.BACKEND_ACTIVE_TRANSACTION;
166:                else if (command.equalsIgnoreCase(Translate
167:                        .get("monitoring.backend.pending.requests"))) //$NON-NLS-1$
168:                    return DataCollection.BACKEND_PENDING_REQUESTS;
169:                else if (command.equalsIgnoreCase(Translate
170:                        .get("monitoring.backend.active.connections"))) //$NON-NLS-1$
171:                    return DataCollection.BACKEND_TOTAL_ACTIVE_CONNECTIONS;
172:                else if (command.equalsIgnoreCase(Translate
173:                        .get("monitoring.backend.total.read.requests"))) //$NON-NLS-1$
174:                    return DataCollection.BACKEND_TOTAL_READ_REQUEST;
175:                else if (command.equalsIgnoreCase(Translate
176:                        .get("monitoring.backend.total.write.requests"))) //$NON-NLS-1$
177:                    return DataCollection.BACKEND_TOTAL_WRITE_REQUEST;
178:                else if (command.equalsIgnoreCase(Translate
179:                        .get("monitoring.backend.total.requests"))) //$NON-NLS-1$
180:                    return DataCollection.BACKEND_TOTAL_REQUEST;
181:                else if (command.equalsIgnoreCase(Translate
182:                        .get("monitoring.backend.total.transactions"))) //$NON-NLS-1$
183:                    return DataCollection.BACKEND_TOTAL_TRANSACTIONS;
184:
185:                /*
186:                 * VirtualDatabase collectors
187:                 */
188:                else if (command.equalsIgnoreCase(Translate
189:                        .get("monitoring.virtualdatabase.active.threads"))) //$NON-NLS-1$
190:                    return DataCollection.DATABASES_ACTIVE_THREADS;
191:                else if (command.equalsIgnoreCase(Translate
192:                        .get("monitoring.virtualdatabase.pending.connections"))) //$NON-NLS-1$
193:                    return DataCollection.DATABASES_PENDING_CONNECTIONS;
194:                else if (command.equalsIgnoreCase(Translate
195:                        .get("monitoring.virtualdatabase.threads.count"))) //$NON-NLS-1$
196:                    return DataCollection.DATABASES_NUMBER_OF_THREADS;
197:
198:                /*
199:                 * Cache stats collectors
200:                 */
201:                else if (command.equalsIgnoreCase(Translate
202:                        .get("monitoring.cache.count.hits"))) //$NON-NLS-1$
203:                    return DataCollection.CACHE_STATS_COUNT_HITS;
204:                else if (command.equalsIgnoreCase(Translate
205:                        .get("monitoring.cache.count.insert"))) //$NON-NLS-1$
206:                    return DataCollection.CACHE_STATS_COUNT_INSERT;
207:                else if (command.equalsIgnoreCase(Translate
208:                        .get("monitoring.cache.count.select"))) //$NON-NLS-1$
209:                    return DataCollection.CACHE_STATS_COUNT_SELECT;
210:                else if (command.equalsIgnoreCase(Translate
211:                        .get("monitoring.cache.hits.ratio"))) //$NON-NLS-1$
212:                    return DataCollection.CACHE_STATS_HITS_PERCENTAGE;
213:                else if (command.equalsIgnoreCase(Translate
214:                        .get("monitoring.cache.number.entries"))) //$NON-NLS-1$
215:                    return DataCollection.CACHE_STATS_NUMBER_ENTRIES;
216:
217:                /*
218:                 * Scheduler collectors
219:                 */
220:                else if (command.equalsIgnoreCase(Translate
221:                        .get("monitoring.scheduler.number.read"))) //$NON-NLS-1$
222:                    return DataCollection.SCHEDULER_NUMBER_READ;
223:                else if (command.equalsIgnoreCase(Translate
224:                        .get("monitoring.scheduler.number.requests"))) //$NON-NLS-1$
225:                    return DataCollection.SCHEDULER_NUMBER_REQUESTS;
226:                else if (command.equalsIgnoreCase(Translate
227:                        .get("monitoring.scheduler.number.writes"))) //$NON-NLS-1$
228:                    return DataCollection.SCHEDULER_NUMBER_WRITES;
229:                else if (command.equalsIgnoreCase(Translate
230:                        .get("monitoring.scheduler.pending.transactions"))) //$NON-NLS-1$
231:                    return DataCollection.SCHEDULER_PENDING_TRANSACTIONS;
232:                else if (command.equalsIgnoreCase(Translate
233:                        .get("monitoring.scheduler.pending.writes"))) //$NON-NLS-1$
234:                    return DataCollection.SCHEDULER_PENDING_WRITES;
235:
236:                /*
237:                 * Client collectors
238:                 */
239:                else if (command.equalsIgnoreCase(Translate
240:                        .get("monitoring.client.active.time"))) //$NON-NLS-1$
241:                    return DataCollection.CLIENT_TIME_ACTIVE;
242:
243:                else
244:                    return 0;
245:            }
246:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.