Source Code Cross Referenced for MessageStatistics.java in  » EJB-Server-JBoss-4.2.1 » messaging » org » jboss » mq » 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 JBoss 4.2.1 » messaging » org.jboss.mq 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * JBoss, Home of Professional Open Source.
003:         * Copyright 2006, Red Hat Middleware LLC, and individual contributors
004:         * as indicated by the @author tags. See the copyright.txt file in the
005:         * distribution for a full listing of individual contributors.
006:         *
007:         * This is free software; you can redistribute it and/or modify it
008:         * under the terms of the GNU Lesser General Public License as
009:         * published by the Free Software Foundation; either version 2.1 of
010:         * the License, or (at your option) any later version.
011:         *
012:         * This software is distributed in the hope that it will be useful,
013:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
014:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015:         * Lesser General Public License for more details.
016:         *
017:         * You should have received a copy of the GNU Lesser General Public
018:         * License along with this software; if not, write to the Free
019:         * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
020:         * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
021:         */
022:        package org.jboss.mq;
023:
024:        import java.io.Serializable;
025:        import java.text.DateFormat;
026:        import java.util.Date;
027:
028:        /**
029:         * Message statistics
030:         * 
031:         * @author <a href="mailto:adrian@jboss.org">Adrian Brock</a>
032:         * @version <tt>$Revision: 57198 $</tt>
033:         */
034:        public class MessageStatistics implements  Serializable {
035:            // Constants -----------------------------------------------------
036:
037:            /** The serialVersionUID */
038:            static final long serialVersionUID = 8056884098781414022L;
039:
040:            // Attributes ----------------------------------------------------
041:
042:            /** Whether we are topic */
043:            private boolean topic;
044:
045:            /** Whether we are durable */
046:            private boolean durable;
047:
048:            /** The name */
049:            private String name;
050:
051:            /** The subscription id */
052:            private String subscriptionID;
053:
054:            /** The message count */
055:            private int count;
056:
057:            /** The message count delta */
058:            private int countDelta;
059:
060:            /** The message depth */
061:            private int depth;
062:
063:            /** The message depth delta */
064:            private int depthDelta;
065:
066:            /** The last update */
067:            private long timeLastUpdate;
068:
069:            // Static --------------------------------------------------------
070:
071:            // Constructors --------------------------------------------------
072:
073:            /**
074:             * Construct a new Message Statistics
075:             */
076:            public MessageStatistics() {
077:            }
078:
079:            // Public --------------------------------------------------------
080:
081:            /**
082:             * Get the count.
083:             * 
084:             * @return Returns the count.
085:             */
086:            public int getCount() {
087:                return count;
088:            }
089:
090:            /**
091:             * Set the count.
092:             * 
093:             * @param count The count to set.
094:             */
095:            public void setCount(int count) {
096:                this .count = count;
097:            }
098:
099:            /**
100:             * Get the countDelta.
101:             * 
102:             * @return Returns the countDelta.
103:             */
104:            public int getCountDelta() {
105:                return countDelta;
106:            }
107:
108:            /**
109:             * Set the countDelta.
110:             * 
111:             * @param countDelta The countDelta to set.
112:             */
113:            public void setCountDelta(int countDelta) {
114:                this .countDelta = countDelta;
115:            }
116:
117:            /**
118:             * Get the depth.
119:             * 
120:             * @return Returns the depth.
121:             */
122:            public int getDepth() {
123:                return depth;
124:            }
125:
126:            /**
127:             * Set the depth.
128:             * 
129:             * @param depth The depth to set.
130:             */
131:            public void setDepth(int depth) {
132:                this .depth = depth;
133:            }
134:
135:            /**
136:             * Get the depthDelta.
137:             * 
138:             * @return Returns the depthDelta.
139:             */
140:            public int getDepthDelta() {
141:                return depthDelta;
142:            }
143:
144:            /**
145:             * Set the depthDelta.
146:             * 
147:             * @param depthDelta The depthDelta to set.
148:             */
149:            public void setDepthDelta(int depthDelta) {
150:                this .depthDelta = depthDelta;
151:            }
152:
153:            /**
154:             * Get the durable.
155:             * 
156:             * @return Returns the durable.
157:             */
158:            public boolean isDurable() {
159:                return durable;
160:            }
161:
162:            /**
163:             * Set the durable.
164:             * 
165:             * @param durable The durable to set.
166:             */
167:            public void setDurable(boolean durable) {
168:                this .durable = durable;
169:            }
170:
171:            /**
172:             * Get the name.
173:             * 
174:             * @return Returns the name.
175:             */
176:            public String getName() {
177:                return name;
178:            }
179:
180:            /**
181:             * Set the name.
182:             * 
183:             * @param name The name to set.
184:             */
185:            public void setName(String name) {
186:                this .name = name;
187:            }
188:
189:            /**
190:             * Get the subscriptionID.
191:             * 
192:             * @return Returns the subscriptionID.
193:             */
194:            public String getSubscriptionID() {
195:                return subscriptionID;
196:            }
197:
198:            /**
199:             * Set the subscriptionID.
200:             * 
201:             * @param subscriptionID The subscriptionID to set.
202:             */
203:            public void setSubscriptionID(String subscriptionID) {
204:                this .subscriptionID = subscriptionID;
205:            }
206:
207:            /**
208:             * Get the timeLastUpdate.
209:             * 
210:             * @return Returns the timeLastUpdate.
211:             */
212:            public long getTimeLastUpdate() {
213:                return timeLastUpdate;
214:            }
215:
216:            /**
217:             * Set the timeLastUpdate.
218:             * 
219:             * @param timeLastUpdate The timeLastUpdate to set.
220:             */
221:            public void setTimeLastUpdate(long timeLastUpdate) {
222:                this .timeLastUpdate = timeLastUpdate;
223:            }
224:
225:            /**
226:             * Get the topic.
227:             * 
228:             * @return Returns the topic.
229:             */
230:            public boolean isTopic() {
231:                return topic;
232:            }
233:
234:            /**
235:             * Set the topic.
236:             * 
237:             * @param topic The topic to set.
238:             */
239:            public void setTopic(boolean topic) {
240:                this .topic = topic;
241:            }
242:
243:            /**
244:             * Get message data as string in format
245:             *
246:             *  "Topic/Queue, Name, Subscription, Durable, Count, CountDelta,
247:             *  Depth, DepthDelta, Timestamp Last Increment"  
248:             *
249:             * @return  String data as a string
250:             */
251:            public String getAsString() {
252:                StringBuffer buffer = new StringBuffer(50);
253:
254:                // Topic/Queue
255:                if (topic)
256:                    buffer.append("Topic,");
257:                else
258:                    buffer.append("Queue,");
259:
260:                // name 
261:                buffer.append(name).append(',');
262:
263:                // subscription
264:                if (subscriptionID != null)
265:                    buffer.append(subscriptionID).append(',');
266:                else
267:                    buffer.append("-,");
268:
269:                // Durable subscription
270:                if (topic) {
271:                    // Topic
272:                    if (durable)
273:                        buffer.append("DURABLE,");
274:                    else
275:                        buffer.append("NONDURABLE,");
276:                } else {
277:                    buffer.append("-,");
278:                }
279:
280:                // counter values
281:                buffer.append(count).append(',').append(countDelta).append(',')
282:                        .append(depth).append(',').append(depthDelta).append(
283:                                ',');
284:
285:                // timestamp last counter update
286:                if (timeLastUpdate > 0) {
287:                    DateFormat dateFormat = DateFormat.getDateTimeInstance(
288:                            DateFormat.SHORT, DateFormat.MEDIUM);
289:
290:                    buffer.append(dateFormat.format(new Date(timeLastUpdate)));
291:                } else {
292:                    buffer.append('-');
293:                }
294:
295:                return buffer.toString();
296:            }
297:
298:            // Object overrides ----------------------------------------------
299:
300:            public String toString() {
301:                return getAsString();
302:            }
303:
304:            // Package protected ---------------------------------------------
305:
306:            // Protected -----------------------------------------------------
307:
308:            // Private -------------------------------------------------------
309:
310:            // Inner classes -------------------------------------------------
311:
312:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.