2 import org.opensrf.util.*;
5 public class Message implements OSRFSerializable {
16 /** Message ID. This number is used to relate requests to responses */
18 /** Type of message. */
20 /** message payload */
21 private Object payload;
23 /** Go ahead and register the Message object */
24 private static OSRFRegistry registry =
25 OSRFRegistry.registerObject(
27 OSRFRegistry.WireProtocol.HASH,
28 new String[] {"threadTrace", "type", "payload"});
31 * @param id This message's ID
32 * @param type The type of message
34 public Message(int id, Type type) {
42 public Type getType() {
45 public Object getPayload() {
48 public void setId(int id) {
51 public void setType(Type type) {
54 public void setPayload(Object p) {
59 * Implements the generic get() API required by OSRFSerializable
61 public Object get(String field) {
62 if("threadTrace".equals(field))
64 if("type".equals(field))
65 return getType().toString();
66 if("payload".equals(field))
71 public OSRFRegistry getRegistry() {