KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > Jt > JtMessage


1
2
3 package Jt;
4
5 import java.io.*;
6
7 /**
8  * Jt Messages used for the implementation of the Jt messaging pattern.
9  * This class is used to pass information to Jt objects.
10  */

11
12 public class JtMessage extends JtObject implements Serializable {
13
14    private Object JavaDoc msgId;
15    private Object JavaDoc msgTo;
16    private Object JavaDoc msgFrom;
17    private Object JavaDoc msgSubject;
18    private Object JavaDoc msgContent;
19    private Object JavaDoc msgData;
20    private Object JavaDoc msgReplyTo;
21    private Object JavaDoc msgAttachment;
22
23
24    public JtMessage () {
25
26    }
27
28    public JtMessage (String JavaDoc msgId) {
29      this.msgId = msgId;
30    }
31
32 /*
33    public JtMessage (Object source) {
34
35    }
36 */

37
38    /**
39     * Returns the message ID.
40     */

41
42    public Object JavaDoc getMsgId () {
43     return msgId;
44    }
45
46    /**
47     * Sets the message ID. This ID will be used by the recipient object to determine
48     * how the message should be processed.
49     * @param newMsgId message ID
50     */

51
52    public void setMsgId(Object JavaDoc newMsgId) {
53     msgId = newMsgId;
54    }
55
56
57    /**
58     * Sets the message recipient. This attribute specifies where the message is going to.
59     * @param newMsgTo message recipient
60     */

61
62    public void setMsgTo (Object JavaDoc newMsgTo) {
63     msgTo = newMsgTo;
64    }
65
66
67    /**
68     * Returns the message recipient.
69     */

70
71    public Object JavaDoc getMsgTo() {
72     return msgTo;
73    }
74
75    /**
76     * Sets the message sender. This attribute specifies where the message is coming from.
77     * @param newMsgFrom message sender
78     */

79
80    public void setMsgFrom (Object JavaDoc newMsgFrom) {
81     msgFrom = newMsgFrom;
82    }
83
84
85    /**
86     * Returns the message sender.
87     */

88
89    public Object JavaDoc getMsgFrom() {
90     return msgFrom;
91    }
92
93    /**
94     * Sets the message subject. This additional message information may be helpful
95     * while processing Jt Messages.
96     * @param newMsgSubject message subject
97     */

98
99    public void setMsgSubject(Object JavaDoc newMsgSubject) {
100     msgSubject = newMsgSubject;
101    }
102
103
104    /**
105     * Returns the message subject.
106     */

107
108    public Object JavaDoc getMsgSubject() {
109     return msgSubject;
110    }
111
112
113    /**
114     * Sets the message content.
115     * @param newMsgContent message content
116     */

117
118    public void setMsgContent(Object JavaDoc newMsgContent) {
119     msgContent = newMsgContent;
120    }
121
122    /**
123     * Returns the message content.
124     */

125
126    public Object JavaDoc getMsgContent() {
127     return msgContent;
128    }
129
130
131    /**
132     * Specifies additional message data. This attribute is seldom used.
133     * @param newMsgData message data
134     */

135
136    public void setMsgData(Object JavaDoc newMsgData) {
137     msgData = newMsgData;
138    }
139
140    /**
141     * Returns additional message data.
142     */

143
144    public Object JavaDoc getMsgData() {
145     return msgData;
146    }
147
148     /**
149     * Specifies the message attachment. This attribute is seldom used.
150     * @param newMsgAttachment message attachment
151     */

152
153    public void setMsgAttachment(Object JavaDoc newMsgAttachment) {
154     msgAttachment = newMsgAttachment;
155    }
156
157
158
159    /**
160     * Returns the message attachment.
161     */

162
163    public Object JavaDoc getMsgAttachment() {
164     return msgAttachment;
165    }
166
167
168    /**
169     * Specifies the object that should receive the reply message.
170     * @param newMsgReplyTo object that should receive the reply.
171     */

172
173
174    public void setMsgReplyTo(Object JavaDoc newMsgReplyTo) {
175     msgReplyTo = newMsgReplyTo;
176    }
177
178
179
180
181    /**
182     * Returns the object that should receive the reply message.
183     */

184  
185    public Object JavaDoc getMsgReplyTo() {
186     return msgReplyTo;
187    }
188
189
190 }
191
Popular Tags