|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--gumbo.net.msg.Message
Abstract base class for messages conforming to the Gumbo client-server message protocol. Messages transferred as an object serialize this whole object, which includes the head and any message-specific transferrable (non-static, non-transient) body data. Messages transferred as ASCII must subclass AsciiMessage.
Subclasses must implement message-specific abstract methods (e.g. getBodyVersion()), and should provide message-specific accessors for the message body contents (parameters and data).
See the javadoc for individual messages for details concerning message parameters, data, and usage.
Constructor Summary | |
Message()
Constructs an empty message with a default head, using defaultHead(). |
Method Summary | |
protected void |
beforeBodyWrite()
Called just before the message body is written. |
protected void |
defaultHead()
Creates and sets the default head for this message. |
abstract java.lang.String |
getBodyVersion()
Gets the version for the message body data format. |
MessageHead |
getHead()
Gets the head for this message. |
java.lang.String |
getMessageType()
Gets the type (fully qualified java class name) of this message. |
protected void |
setHead(MessageHead head)
Sets the head for this message. |
abstract java.lang.String |
toBodyString()
Creates a new string representing the contents of the message body for status messages. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Message()
Method Detail |
protected void defaultHead()
protected void setHead(MessageHead head) throws MessageDataException
head
- Initialized message head. Never null.
MessageDataException
- Head uninitialized or mismatch between
head data and implicit message type or body version.public MessageHead getHead()
public java.lang.String getMessageType()
public abstract java.lang.String getBodyVersion()
protected void beforeBodyWrite()
public abstract java.lang.String toBodyString()
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |