KickJava   Java API By Example, From Geeks To Geeks.

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


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 javax.jms.JMSException JavaDoc;
10 import javax.jms.ObjectMessage JavaDoc;
11 import java.io.Serializable JavaDoc;
12
13 /**
14  * @author <a HREF="mailto:nathan@jboss.org">Nathan Phelps</a>
15  * @version $Revision: 1.2 $ $Date: 2003/08/21 10:07:04 $
16  */

17 public class ObjectMessageImpl extends MessageImpl implements ObjectMessage JavaDoc
18 {
19
20     ObjectMessageImpl()
21     {
22         super.type = MessageImpl.OBJECT_MESSAGE_NAME;
23     }
24
25     public ObjectMessageImpl(Serializable JavaDoc object)
26     {
27         super.type = MessageImpl.OBJECT_MESSAGE_NAME;
28         super.body = object;
29     }
30
31     public Serializable JavaDoc getObject() throws JMSException JavaDoc
32     {
33         return (Serializable JavaDoc) super.body;
34     }
35
36     public void setObject(Serializable JavaDoc object) throws JMSException JavaDoc
37     {
38         super.throwExceptionIfReadOnly();
39         super.body = object;
40     }
41
42 }
Popular Tags