Source Code Cross Referenced for ServiceUnitStatisticsData.java in  » ESB » open-esb » com » sun » esb » management » common » data » 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 » ESB » open esb » com.sun.esb.management.common.data 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /* 
002:         * BEGIN_HEADER - DO NOT EDIT
003:         *
004:         * The contents of this file are subject to the terms
005:         * of the Common Development and Distribution License
006:         * (the "License").  You may not use this file except
007:         * in compliance with the License.
008:         *
009:         * You can obtain a copy of the license at
010:         * https://open-esb.dev.java.net/public/CDDLv1.0.html.
011:         * See the License for the specific language governing
012:         * permissions and limitations under the License.
013:         *
014:         * When distributing Covered Code, include this CDDL
015:         * HEADER in each file and include the License file at
016:         * https://open-esb.dev.java.net/public/CDDLv1.0.html.
017:         * If applicable add the following below this CDDL HEADER,
018:         * with the fields enclosed by brackets "[]" replaced with
019:         * your own identifying information: Portions Copyright
020:         * [year] [name of copyright owner]
021:         */
022:
023:        /*
024:         * @(#)ServiceUnitStatisticsData.java
025:         * Copyright 2004-2007 Sun Microsystems, Inc. All Rights Reserved.
026:         *
027:         * END_HEADER - DO NOT EDIT
028:         */
029:        package com.sun.esb.management.common.data;
030:
031:        import java.io.Serializable;
032:        import java.util.ArrayList;
033:        import java.util.Collection;
034:        import java.util.List;
035:
036:        /**
037:         * Provides Service Unit Statistics
038:         * 
039:         * @author graj
040:         * 
041:         */
042:        public class ServiceUnitStatisticsData implements  Serializable {
043:            static final long serialVersionUID = -1L;
044:
045:            public static final String NAME_KEY = "ServiceUnitName";
046:
047:            public static final String STARTUP_TIME_AVG_KEY = "ServiceUnitStartupTime Avg (ms)";
048:
049:            public static final String STOP_TIME_AVG_KEY = "ServiceUnitStopTime Avg (ms)";
050:
051:            public static final String SHUTDOWN_TIME_AVG_KEY = "ServiceUnitShutdownTime Avg (ms)";
052:
053:            public static final String ENDPOINTS_KEY = "Endpoints";
054:
055:            protected String name;
056:
057:            protected long startupTimeAverage;
058:
059:            protected long stopTimeAverage;
060:
061:            protected long shutdownTimeAverage;
062:
063:            protected List<String /* endpointName */> endpointNameList = new ArrayList<String /* endpointName */>();
064:
065:            /** Constructor - creates a ServiceUnitStatisticsData object */
066:            public ServiceUnitStatisticsData() {
067:            }
068:
069:            /**
070:             * @return the serviceUnitName
071:             */
072:            public String getName() {
073:                return this .name;
074:            }
075:
076:            /**
077:             * @param serviceUnitName
078:             *            the serviceUnitName to set
079:             */
080:            public void setName(String serviceUnitName) {
081:                this .name = serviceUnitName;
082:            }
083:
084:            /**
085:             * @return the startupTimeAverage
086:             */
087:            public double getStartupTimeAverage() {
088:                return this .startupTimeAverage;
089:            }
090:
091:            /**
092:             * @param startupTimeAverage
093:             *            the startupTimeAverage to set
094:             */
095:            public void setStartupTimeAverage(long serviceUnitStartTime) {
096:                this .startupTimeAverage = serviceUnitStartTime;
097:            }
098:
099:            /**
100:             * @return the stopTimeAverage
101:             */
102:            public double getStopTimeAverage() {
103:                return this .stopTimeAverage;
104:            }
105:
106:            /**
107:             * @param stopTimeAverage
108:             *            the stopTimeAverage to set
109:             */
110:            public void setStopTimeAverage(long serviceUnitStopTime) {
111:                this .stopTimeAverage = serviceUnitStopTime;
112:            }
113:
114:            /**
115:             * @return the shutdownTimeAverage
116:             */
117:            public double getShutdownTimeAverage() {
118:                return this .shutdownTimeAverage;
119:            }
120:
121:            /**
122:             * @param shutdownTimeAverage
123:             *            the shutdownTimeAverage to set
124:             */
125:            public void setShutdownTimeAverage(long serviceUnitShutdownTime) {
126:                this .shutdownTimeAverage = serviceUnitShutdownTime;
127:            }
128:
129:            /**
130:             * @return the endpointNameList
131:             */
132:            public List<String> getEndpointNameList() {
133:                return this .endpointNameList;
134:            }
135:
136:            /**
137:             * @return the endpointNameArray
138:             */
139:            public String[] getEndpointNameArray() {
140:                String[] result = toArray(this .endpointNameList, String.class);
141:                return result;
142:            }
143:
144:            /**
145:             * @param endpointNameList
146:             *            the endpointNameList to set
147:             */
148:            public void setEndpointNameList(List<String> endpointNameList) {
149:                this .endpointNameList = endpointNameList;
150:            }
151:
152:            /**
153:             * @param endpointNameArray
154:             *            the endpointNameArray to set
155:             */
156:            public void setEndpointNameList(String[] endpointNameArray) {
157:                for (String endpointName : endpointNameArray) {
158:                    this .endpointNameList.add(endpointName);
159:                }
160:            }
161:
162:            /**
163:             * Convert a collection to an array
164:             * 
165:             * @param collection
166:             * @param componentType
167:             * @return
168:             */
169:            @SuppressWarnings("unchecked")
170:            static protected <Type> Type[] toArray(Collection<Type> collection,
171:                    Class<Type> componentType) {
172:                // unchecked cast
173:                Type[] array = (Type[]) java.lang.reflect.Array.newInstance(
174:                        componentType, collection.size());
175:                int index = 0;
176:                for (Type value : collection) {
177:                    array[index++] = value;
178:                }
179:                return array;
180:            }
181:
182:            /**
183:             * 
184:             * @return
185:             */
186:            public String getDisplayString() {
187:                StringBuffer buffer = new StringBuffer();
188:                buffer.append("\n    Service Unit Name" + "=" + this .getName());
189:                buffer.append("\n    Service Unit Shutdown Time" + "="
190:                        + this .getShutdownTimeAverage());
191:                buffer.append("\n    Service Unit Start Time" + "="
192:                        + this .getStartupTimeAverage());
193:                buffer.append("\n    Service Unit Stop Time" + "="
194:                        + this .getStopTimeAverage());
195:                if ((this .getEndpointNameList() != null)
196:                        && (this .getEndpointNameList().size() > 0)) {
197:                    buffer.append("\n    Endpoints List:");
198:                    for (String endpoint : this .getEndpointNameList()) {
199:                        buffer.append("\n      Endpoint Name" + "=" + endpoint);
200:                    }
201:                }
202:                buffer.append("\n\n");
203:                return buffer.toString();
204:
205:            }
206:
207:            /**
208:             * @param args
209:             */
210:            public static void main(String[] args) {
211:                // TODO Auto-generated method stub
212:
213:            }
214:
215:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.