Source Code Cross Referenced for JettyWebContainerStatsImpl.java in  » EJB-Server-geronimo » management » org » apache » geronimo » management » geronimo » stats » 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 » EJB Server geronimo » management » org.apache.geronimo.management.geronimo.stats 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         *  Licensed to the Apache Software Foundation (ASF) under one or more
003:         *  contributor license agreements.  See the NOTICE file distributed with
004:         *  this work for additional information regarding copyright ownership.
005:         *  The ASF licenses this file to You under the Apache License, Version 2.0
006:         *  (the "License"); you may not use this file except in compliance with
007:         *  the License.  You may obtain a copy of 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,
013:         *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014:         *  See the License for the specific language governing permissions and
015:         *  limitations under the License.
016:         */package org.apache.geronimo.management.geronimo.stats;
017:
018:        import javax.management.j2ee.statistics.CountStatistic;
019:        import javax.management.j2ee.statistics.RangeStatistic;
020:        import javax.management.j2ee.statistics.TimeStatistic;
021:
022:        import org.apache.geronimo.management.stats.CountStatisticImpl;
023:        import org.apache.geronimo.management.stats.RangeStatisticImpl;
024:        import org.apache.geronimo.management.stats.StatisticImpl;
025:        import org.apache.geronimo.management.stats.StatsImpl;
026:        import org.apache.geronimo.management.stats.TimeStatisticImpl;
027:
028:        /**
029:         * Jetty implementation of the Geronimo stats interface WebContainerStats
030:         *
031:         * @version $Revision: 1.0$
032:         */
033:        public class JettyWebContainerStatsImpl extends StatsImpl implements 
034:                JettyWebContainerStats {
035:            private RangeStatisticImpl activeRequestCount;
036:            private TimeStatisticImpl requestDuration;
037:            private CountStatisticImpl response1xx;
038:            private CountStatisticImpl response2xx;
039:            private CountStatisticImpl response3xx;
040:            private CountStatisticImpl response4xx;
041:            private CountStatisticImpl response5xx;
042:            private CountStatisticImpl statsOnMs; // time elapsed since the stats collection
043:
044:            public JettyWebContainerStatsImpl() {
045:                activeRequestCount = new RangeStatisticImpl(
046:                        "Active Request Count", StatisticImpl.UNIT_COUNT,
047:                        "The number of requests being processed concurrently");
048:                requestDuration = new TimeStatisticImpl("Request Duration",
049:                        StatisticImpl.UNIT_TIME_MILLISECOND,
050:                        "The length of time that it's taken to handle individual requests");
051:                response1xx = new CountStatisticImpl("Response 1xx",
052:                        StatisticImpl.UNIT_COUNT, "The number of 1xx responses");
053:                response2xx = new CountStatisticImpl("Response 2xx",
054:                        StatisticImpl.UNIT_COUNT, "The number of 2xx responses");
055:                response3xx = new CountStatisticImpl("Response 3xx",
056:                        StatisticImpl.UNIT_COUNT, "The number of 3xx responses");
057:                response4xx = new CountStatisticImpl("Response 4xx",
058:                        StatisticImpl.UNIT_COUNT, "The number of 4xx responses");
059:                response5xx = new CountStatisticImpl("Response 5xx",
060:                        StatisticImpl.UNIT_COUNT, "The number of 5xx responses");
061:                statsOnMs = new CountStatisticImpl("Stats Duration",
062:                        StatisticImpl.UNIT_TIME_MILLISECOND,
063:                        "The length of time that statistics have been collected.");
064:
065:                addStat("ActiveRequestCount", activeRequestCount);
066:                addStat("RequestDuration", requestDuration);
067:                addStat("Responses1xx", response1xx);
068:                addStat("Responses2xx", response2xx);
069:                addStat("Responses3xx", response3xx);
070:                addStat("Responses4xx", response4xx);
071:                addStat("Responses5xx", response5xx);
072:                addStat("StatsDuration", statsOnMs); // TODO - remove this
073:            }
074:
075:            /**
076:             * Public methods to return the interfaces for statistics.
077:             * These are used by the objects (such as the web console) that
078:             * retrieve the stats for presentation purposes.
079:             */
080:
081:            public RangeStatistic getActiveRequestCount() {
082:                return activeRequestCount;
083:            }
084:
085:            public TimeStatistic getRequestDuration() {
086:                return requestDuration;
087:            }
088:
089:            /**
090:             * @return Gets the number of 1xx status returned by this
091:             * context since last call of stats reset.
092:             */
093:            public CountStatistic getResponses1xx() {
094:                return response1xx;
095:            }
096:
097:            /**
098:             * @return Gets the number of 2xx status returned by this
099:             * context since last call of stats reset.
100:             */
101:            public CountStatistic getResponses2xx() {
102:                return response2xx;
103:            }
104:
105:            /**
106:             * @return Gets the number of 3xx status returned by this
107:             * context since last call of stats reset.
108:             */
109:            public CountStatistic getResponses3xx() {
110:                return response3xx;
111:            }
112:
113:            /**
114:             * @return Gets the number of 4xx status returned by this
115:             * context since last call of stats reset.
116:             */
117:            public CountStatistic getResponses4xx() {
118:                return response4xx;
119:            }
120:
121:            /**
122:             * @return Gets the number of 5xx status returned by this
123:             * context since last call of stats reset.
124:             */
125:            public CountStatistic getResponses5xx() {
126:                return response5xx;
127:            }
128:
129:            /**
130:             * @return Time in millis since statistics collection was started.
131:             */
132:            public CountStatistic getStatsOnMs() {
133:                return statsOnMs;
134:            }
135:
136:            /**
137:             * Public methods to return the implementations for statistics.
138:             * These are used by the JettyContainerImpl to set the values.
139:             */
140:
141:            public RangeStatisticImpl getActiveRequestCountImpl() {
142:                return activeRequestCount;
143:            }
144:
145:            public TimeStatisticImpl getRequestDurationImpl() {
146:                return requestDuration;
147:            }
148:
149:            /**
150:             * @return Gets the number of 1xx status returned by this
151:             * context since last call of stats reset.
152:             */
153:            public CountStatisticImpl getResponses1xxImpl() {
154:                return response1xx;
155:            }
156:
157:            /**
158:             * @return Gets the number of 2xx status returned by this
159:             * context since last call of stats reset.
160:             */
161:            public CountStatisticImpl getResponses2xxImpl() {
162:                return response2xx;
163:            }
164:
165:            /**
166:             * @return Gets the number of 3xx status returned by this
167:             * context since last call of stats reset.
168:             */
169:            public CountStatisticImpl getResponses3xxImpl() {
170:                return response3xx;
171:            }
172:
173:            /**
174:             * @return Gets the number of 4xx status returned by this
175:             * context since last call of stats reset.
176:             */
177:            public CountStatisticImpl getResponses4xxImpl() {
178:                return response4xx;
179:            }
180:
181:            /**
182:             * @return Gets the number of 5xx status returned by this
183:             * context since last call of stats reset.
184:             */
185:            public CountStatisticImpl getResponses5xxImpl() {
186:                return response5xx;
187:            }
188:
189:            /**
190:             * @return Time in millis since statistics collection was started.
191:             */
192:            public CountStatisticImpl getStatsOnMsImpl() {
193:                return statsOnMs;
194:            }
195:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.