KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mule > providers > gs > JiniMessage


1 /*
2  * $Id: JiniMessage.java 3798 2006-11-04 04:07:14Z aperepel $
3  * --------------------------------------------------------------------------------------
4  * Copyright (c) MuleSource, Inc. All rights reserved. http://www.mulesource.com
5  *
6  * The software in this package is published under the terms of the MuleSource MPL
7  * license, a copy of which has been included with this distribution in the
8  * LICENSE.txt file.
9  */

10
11 package org.mule.providers.gs;
12
13 import java.util.Map JavaDoc;
14
15 import net.jini.core.entry.Entry;
16
17 import org.mule.umo.UMOExceptionPayload;
18 import org.mule.util.MapUtils;
19
20 /**
21  * The default wrapper Template for a GigaSpace entry
22  */

23 public class JiniMessage implements Entry
24 {
25     /**
26      * Serial version
27      */

28     private static final long serialVersionUID = 2373851288156547780L;
29
30     public Object JavaDoc destination;
31     public Object JavaDoc payload;
32     public String JavaDoc correlationId;
33     public Integer JavaDoc correlationSequence;
34     public Integer JavaDoc correlationGroupSize;
35     public Object JavaDoc replyTo;
36     public String JavaDoc messageId;
37     public Map JavaDoc properties;
38     public String JavaDoc encoding;
39     public UMOExceptionPayload exceptionPayload;
40     public String JavaDoc payloadType;
41
42     public JiniMessage()
43     {
44         super();
45     }
46
47     /**
48      * @param destination
49      * @param payload
50      */

51     public JiniMessage(Object JavaDoc destination, Object JavaDoc payload)
52     {
53         super();
54         this.destination = destination;
55         setPayload(payload);
56     }
57
58     public String JavaDoc getCorrelationId()
59     {
60         return correlationId;
61     }
62
63     public void setCorrelationId(String JavaDoc correlationId)
64     {
65         this.correlationId = correlationId;
66     }
67
68     public Integer JavaDoc getCorrelationSequence()
69     {
70         return correlationSequence;
71     }
72
73     public void setCorrelationSequence(Integer JavaDoc correlationSequence)
74     {
75         this.correlationSequence = correlationSequence;
76     }
77
78     public Integer JavaDoc getCorrelationGroupSize()
79     {
80         return correlationGroupSize;
81     }
82
83     public void setCorrelationGroupSize(Integer JavaDoc correlationGroupSize)
84     {
85         this.correlationGroupSize = correlationGroupSize;
86     }
87
88     public Object JavaDoc getReplyTo()
89     {
90         return replyTo;
91     }
92
93     public void setReplyTo(Object JavaDoc replyTo)
94     {
95         this.replyTo = replyTo;
96     }
97
98     public String JavaDoc getMessageId()
99     {
100         return messageId;
101     }
102
103     public void setMessageId(String JavaDoc messageId)
104     {
105         this.messageId = messageId;
106     }
107
108     /**
109      * @return Returns the destination.
110      */

111     public Object JavaDoc getDestination()
112     {
113         return destination;
114     }
115
116     /**
117      * @param destination The destination to set.
118      */

119     public void setDestination(Object JavaDoc destination)
120     {
121         this.destination = destination;
122     }
123
124     /**
125      * @return Returns the payload.
126      */

127     public Object JavaDoc getPayload()
128     {
129         return payload;
130     }
131
132     /**
133      * @param payload The payload to set.
134      */

135     public void setPayload(Object JavaDoc payload)
136     {
137         this.payload = payload;
138         if (payload != null)
139         {
140             payloadType = payload.getClass().getName();
141         }
142         else
143         {
144             payloadType = null;
145         }
146     }
147
148     public Map JavaDoc getProperties()
149     {
150         return properties;
151     }
152
153     public void setProperties(Map JavaDoc properties)
154     {
155         this.properties = properties;
156     }
157
158     public String JavaDoc getEncoding()
159     {
160         return encoding;
161     }
162
163     public void setEncoding(String JavaDoc encoding)
164     {
165         this.encoding = encoding;
166     }
167
168     public UMOExceptionPayload getExceptionPayload()
169     {
170         return exceptionPayload;
171     }
172
173     public void setExceptionPayload(UMOExceptionPayload exceptionPayload)
174     {
175         this.exceptionPayload = exceptionPayload;
176     }
177
178     public String JavaDoc getPayloadType()
179     {
180         return payloadType;
181     }
182
183     public void setPayloadType(String JavaDoc payloadType)
184     {
185         this.payloadType = payloadType;
186     }
187
188     public String JavaDoc toString()
189     {
190         StringBuffer JavaDoc buf = new StringBuffer JavaDoc(120);
191         buf.append(getClass().getName());
192         buf.append('{');
193         buf.append("id=").append(getMessageId());
194         buf.append(", payload=").append((getPayload() != null ? getPayload().getClass().getName() : "null"));
195         buf.append(", correlationId=").append(getCorrelationId());
196         buf.append(", correlationGroup=").append(getCorrelationGroupSize());
197         buf.append(", correlationSeq=").append(getCorrelationSequence());
198         buf.append(", encoding=").append(getEncoding());
199         buf.append(", exceptionPayload=").append(getExceptionPayload());
200         buf.append(", properties=").append(MapUtils.toString(properties, true));
201         buf.append('}');
202         return buf.toString();
203     }
204
205 }
206
Popular Tags