Source Code Cross Referenced for MapMessageImpl.java in  » Testing » MockEJB » org » mockejb » jms » 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 » Testing » MockEJB » org.mockejb.jms 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package org.mockejb.jms;
002:
003:        import java.util.*;
004:        import javax.jms.*;
005:
006:        /**
007:         * <code>MapMessage</code> implementation.
008:         * @author Dimitar Gospodinov
009:         * @see javax.jms.MapMessage
010:         */
011:        public class MapMessageImpl extends MessageImpl implements  MapMessage {
012:
013:            private final PrimitiveMap map = new PrimitiveMap();
014:
015:            /**
016:             * Creates empty <code>MapMessageImpl<code> 
017:             */
018:            public MapMessageImpl() {
019:                super ();
020:            }
021:
022:            /**
023:             * Creates <code>MapMessageImpl</code> and copies its header, properties and
024:             * body from <code>msg<code>
025:             * @param msg
026:             * @throws JMSException
027:             */
028:            public MapMessageImpl(MapMessage msg) throws JMSException {
029:                super (msg);
030:
031:                Enumeration e = msg.getMapNames();
032:                while (e.hasMoreElements()) {
033:                    String name = (String) e.nextElement();
034:                    setObject(name, msg.getObject(name));
035:                }
036:            }
037:
038:            /**
039:             * @see javax.jms.MapMessage#getBoolean(java.lang.String)
040:             */
041:            public boolean getBoolean(String name) throws JMSException {
042:                return map.getBoolean(name);
043:            }
044:
045:            /**
046:             * @see javax.jms.MapMessage#getByte(java.lang.String)
047:             */
048:            public byte getByte(String name) throws JMSException {
049:                return map.getByte(name);
050:            }
051:
052:            /**
053:             * @see javax.jms.MapMessage#getShort(java.lang.String)
054:             */
055:            public short getShort(String name) throws JMSException {
056:                return map.getShort(name);
057:            }
058:
059:            /**
060:             * @see javax.jms.MapMessage#getChar(java.lang.String)
061:             */
062:            public char getChar(String name) throws JMSException {
063:                return map.getChar(name);
064:            }
065:
066:            /**
067:             * @see javax.jms.MapMessage#getInt(java.lang.String)
068:             */
069:            public int getInt(String name) throws JMSException {
070:                return map.getInt(name);
071:            }
072:
073:            /**
074:             * @see javax.jms.MapMessage#getLong(java.lang.String)
075:             */
076:            public long getLong(String name) throws JMSException {
077:                return map.getLong(name);
078:            }
079:
080:            /**
081:             * @see javax.jms.MapMessage#getFloat(java.lang.String)
082:             */
083:            public float getFloat(String name) throws JMSException {
084:                return map.getFloat(name);
085:            }
086:
087:            /**
088:             * @see javax.jms.MapMessage#getDouble(java.lang.String)
089:             */
090:            public double getDouble(String name) throws JMSException {
091:                return map.getDouble(name);
092:            }
093:
094:            /**
095:             * @see javax.jms.MapMessage#getString(java.lang.String)
096:             */
097:            public String getString(String name) throws JMSException {
098:                return map.getString(name);
099:            }
100:
101:            /**
102:             * @see javax.jms.MapMessage#getBytes(java.lang.String)
103:             */
104:            public byte[] getBytes(String name) throws JMSException {
105:                return map.getBytes(name);
106:            }
107:
108:            /**
109:             * @see javax.jms.MapMessage#getObject(java.lang.String)
110:             */
111:            public Object getObject(String name) throws JMSException {
112:                return map.getObject(name);
113:            }
114:
115:            /**
116:             * @see javax.jms.MapMessage#getMapNames()
117:             */
118:            public Enumeration getMapNames() throws JMSException {
119:                return map.getNames();
120:            }
121:
122:            /**
123:             * @see javax.jms.MapMessage#setBoolean(java.lang.String, boolean)
124:             */
125:            public void setBoolean(String name, boolean value)
126:                    throws JMSException {
127:                checkBodyWriteable();
128:                map.setBoolean(name, value);
129:            }
130:
131:            /**
132:             * @see javax.jms.MapMessage#setByte(java.lang.String, byte)
133:             */
134:            public void setByte(String name, byte value) throws JMSException {
135:                checkBodyWriteable();
136:                map.setByte(name, value);
137:            }
138:
139:            /**
140:             * @see javax.jms.MapMessage#setShort(java.lang.String, short)
141:             */
142:            public void setShort(String name, short value) throws JMSException {
143:                checkBodyWriteable();
144:                map.setShort(name, value);
145:            }
146:
147:            /**
148:             * @see javax.jms.MapMessage#setChar(java.lang.String, char)
149:             */
150:            public void setChar(String name, char value) throws JMSException {
151:                checkBodyWriteable();
152:                map.setChar(name, value);
153:            }
154:
155:            /**
156:             * @see javax.jms.MapMessage#setInt(java.lang.String, int)
157:             */
158:            public void setInt(String name, int value) throws JMSException {
159:                checkBodyWriteable();
160:                map.setInt(name, value);
161:            }
162:
163:            /**
164:             * @see javax.jms.MapMessage#setLong(java.lang.String, long)
165:             */
166:            public void setLong(String name, long value) throws JMSException {
167:                checkBodyWriteable();
168:                map.setLong(name, value);
169:            }
170:
171:            /**
172:             * @see javax.jms.MapMessage#setFloat(java.lang.String, float)
173:             */
174:            public void setFloat(String name, float value) throws JMSException {
175:                checkBodyWriteable();
176:                map.setFloat(name, value);
177:            }
178:
179:            /**
180:             * @see javax.jms.MapMessage#setDouble(java.lang.String, double)
181:             */
182:            public void setDouble(String name, double value)
183:                    throws JMSException {
184:                checkBodyWriteable();
185:                map.setDouble(name, value);
186:            }
187:
188:            /**
189:             * @see javax.jms.MapMessage#setString(java.lang.String, java.lang.String)
190:             */
191:            public void setString(String name, String value)
192:                    throws JMSException {
193:                checkBodyWriteable();
194:                map.setString(name, value);
195:            }
196:
197:            /**
198:             * @see javax.jms.MapMessage#setBytes(java.lang.String, byte[])
199:             */
200:            public void setBytes(String name, byte[] value) throws JMSException {
201:                checkBodyWriteable();
202:                map.setBytes(name, value);
203:            }
204:
205:            /**
206:             * @see javax.jms.MapMessage#setBytes(java.lang.String, byte[], int, int)
207:             */
208:            public void setBytes(String name, byte[] value, int offset,
209:                    int length) throws JMSException {
210:
211:                checkBodyWriteable();
212:
213:                if (value == null || length < 0 || offset < 0
214:                        || (offset + length) > value.length) {
215:                    throw new IllegalArgumentException();
216:                }
217:                byte[] valueToSet = new byte[length];
218:                int i = 0;
219:                while (length > 0) {
220:                    valueToSet[i++] = value[offset++];
221:                    length--;
222:                }
223:                map.setBytes(name, valueToSet);
224:            }
225:
226:            /**
227:             * @see javax.jms.MapMessage#setObject(java.lang.String, java.lang.Object)
228:             */
229:            public void setObject(String name, Object value)
230:                    throws JMSException {
231:                checkBodyWriteable();
232:                map.setObject(name, value);
233:            }
234:
235:            /**
236:             * @see javax.jms.MapMessage#itemExists(java.lang.String)
237:             */
238:            public boolean itemExists(String name) throws JMSException {
239:                return map.containsKey(name);
240:            }
241:
242:            // Non-standard methods
243:
244:            /**
245:             * Sets message body in read-only mode.
246:             * @throws JMSException
247:             */
248:            void resetBody() throws JMSException {
249:                setBodyReadOnly();
250:            }
251:
252:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.