KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > jms > MapMessageImpl


1 /*
2  * JBoss, the OpenSource J2EE webOS
3  *
4  * Distributable under LGPL license.
5  * See terms of license at gnu.org.
6  */

7 package org.jboss.jms;
8
9 import org.jboss.jms.util.JMSMap;
10
11 import javax.jms.JMSException JavaDoc;
12 import javax.jms.MapMessage JavaDoc;
13 import java.util.Enumeration JavaDoc;
14
15 /**
16  * @author <a HREF="mailto:nathan@jboss.org">Nathan Phelps</a>
17  * @version $Revision: 1.2 $ $Date: 2003/08/21 10:07:04 $
18  */

19 public class MapMessageImpl extends MessageImpl implements MapMessage JavaDoc
20 {
21
22     public MapMessageImpl()
23     {
24         super.type = MessageImpl.MAP_MESSAGE_NAME;
25         super.body = JMSMap.createInstance(MapMessage JavaDoc.class);
26     }
27
28     public void clearBody()
29     {
30         this.getBody().clear();
31         this.setReadOnly(false);
32     }
33
34     private JMSMap getBody()
35     {
36         return (JMSMap) super.body;
37     }
38
39     public final boolean getBoolean(String JavaDoc name) throws JMSException JavaDoc
40     {
41         return this.getBody().getBoolean(name);
42     }
43
44     public final byte getByte(String JavaDoc name) throws JMSException JavaDoc
45     {
46         return this.getBody().getByte(name);
47     }
48
49     public final byte[] getBytes(String JavaDoc name) throws JMSException JavaDoc
50     {
51         return this.getBody().getBytes(name);
52     }
53
54     public final char getChar(String JavaDoc name) throws JMSException JavaDoc
55     {
56         return this.getBody().getChar(name);
57     }
58
59     public final double getDouble(String JavaDoc name) throws JMSException JavaDoc
60     {
61         return this.getBody().getDouble(name);
62     }
63
64     public final float getFloat(String JavaDoc name) throws JMSException JavaDoc
65     {
66         return this.getBody().getFloat(name);
67     }
68
69     public final int getInt(String JavaDoc name) throws JMSException JavaDoc
70     {
71         return this.getBody().getInt(name);
72     }
73
74     public final long getLong(String JavaDoc name) throws JMSException JavaDoc
75     {
76         return this.getBody().getLong(name);
77     }
78
79     public final Enumeration JavaDoc getMapNames() throws JMSException JavaDoc
80     {
81         return this.getBody().getMapNames();
82     }
83
84     public final Object JavaDoc getObject(String JavaDoc name) throws JMSException JavaDoc
85     {
86         return this.getBody().getObject(name);
87     }
88
89     public final short getShort(String JavaDoc name) throws JMSException JavaDoc
90     {
91         return this.getBody().getShort(name);
92     }
93
94     public final String JavaDoc getString(String JavaDoc name) throws JMSException JavaDoc
95     {
96         return this.getBody().getString(name);
97     }
98
99     public final boolean itemExists(String JavaDoc name) throws JMSException JavaDoc
100     {
101         return this.getBody().itemExists(name);
102     }
103
104     public final void setBoolean(String JavaDoc name, boolean value) throws JMSException JavaDoc
105     {
106         super.throwExceptionIfReadOnly();
107         this.getBody().setBoolean(name, value);
108     }
109
110     public final void setByte(String JavaDoc name, byte value) throws JMSException JavaDoc
111     {
112         super.throwExceptionIfReadOnly();
113         this.getBody().setByte(name, value);
114     }
115
116     public final void setBytes(String JavaDoc name, byte[] value) throws JMSException JavaDoc
117     {
118         super.throwExceptionIfReadOnly();
119         this.getBody().setBytes(name, value);
120     }
121
122     public final void setBytes(String JavaDoc name, byte[] value, int offset, int length)
123             throws JMSException JavaDoc
124     {
125         super.throwExceptionIfReadOnly();
126         this.getBody().setBytes(name, value, offset, length);
127     }
128
129     public final void setChar(String JavaDoc name, char value) throws JMSException JavaDoc
130     {
131         super.throwExceptionIfReadOnly();
132         this.getBody().setChar(name, value);
133     }
134
135     public final void setDouble(String JavaDoc name, double value) throws JMSException JavaDoc
136     {
137         super.throwExceptionIfReadOnly();
138         this.setDouble(name, value);
139     }
140
141     public final void setFloat(String JavaDoc name, float value) throws JMSException JavaDoc
142     {
143         super.throwExceptionIfReadOnly();
144         this.getBody().setFloat(name, value);
145     }
146
147     public final void setInt(String JavaDoc name, int value) throws JMSException JavaDoc
148     {
149         super.throwExceptionIfReadOnly();
150         this.getBody().setInt(name, value);
151     }
152
153     public final void setLong(String JavaDoc name, long value) throws JMSException JavaDoc
154     {
155         super.throwExceptionIfReadOnly();
156         this.getBody().setLong(name, value);
157     }
158
159     public final void setObject(String JavaDoc name, Object JavaDoc value) throws JMSException JavaDoc
160     {
161         super.throwExceptionIfReadOnly();
162         this.getBody().setObject(name, name);
163     }
164
165     public final void setShort(String JavaDoc name, short value) throws JMSException JavaDoc
166     {
167         super.throwExceptionIfReadOnly();
168         this.getBody().setShort(name, value);
169     }
170
171     public final void setString(String JavaDoc name, String JavaDoc value) throws JMSException JavaDoc
172     {
173         super.throwExceptionIfReadOnly();
174         this.getBody().setString(name, value);
175     }
176
177 }
Popular Tags