01: package dalma.endpoints.jms.impl;
02:
03: import javax.jms.JMSException;
04: import javax.jms.ObjectMessage;
05: import java.io.Serializable;
06:
07: /**
08: * {@link Serializable} {@link ObjectMessage}.
09: *
10: * @author Kohsuke Kawaguchi
11: */
12: public class ObjectMessageImpl extends MessageImpl<ObjectMessage>
13: implements ObjectMessage {
14: private Serializable object;
15:
16: public ObjectMessageImpl() {
17: }
18:
19: public ObjectMessageImpl wrap(ObjectMessage s) throws JMSException {
20: super .wrap(s);
21: object = s.getObject();
22: return this ;
23: }
24:
25: public void writeTo(ObjectMessage d) throws JMSException {
26: super .writeTo(d);
27: d.setObject(object);
28: }
29:
30: public void clearBody() throws JMSException {
31: object = null;
32: }
33:
34: public void setObject(Serializable object) throws JMSException {
35: this .object = object;
36: }
37:
38: public Serializable getObject() throws JMSException {
39: return object;
40: }
41:
42: private static final long serialVersionUID = 1L;
43: }
|