public class MessageType extends java.lang.Object implements java.io.Serializable, Marshallable
MessageCatalog.
Applications should declare static MessageType
instances using intern(java.lang.String) and reuse that object. For example:
public static MessageType MSG_TYPE_SKY_FALLING = MessageType.intern("me.SKY_FALLING");
It is suggested that the MessageType string name be derived from the
program identifier. Atavism reserves all names beginning with "ao.".| Modifier and Type | Field and Description |
|---|---|
protected static java.util.Map<java.lang.String,MessageType> |
internedMsgTypes |
protected java.lang.Integer |
msgTypeNumber |
protected java.lang.String |
msgTypeString |
| Modifier | Constructor and Description |
|---|---|
|
MessageType()
No argument constructor is needed for marshalling.
|
protected |
MessageType(java.lang.String msgTypeString) |
| Modifier and Type | Method and Description |
|---|---|
int |
getMsgTypeNumber()
Get message type number.
|
java.lang.String |
getMsgTypeString()
Get message type name.
|
static MessageType |
intern(java.lang.String typeName)
Get singleton MessageType instance for a message type name.
|
void |
marshalObject(AOByteBuffer buf)
Internal use only.
|
static MessageType |
readObjectUtility(java.io.ObjectInputStream in)
Internal use only.
|
void |
setMsgTypeNumber(int msgTypeNumber)
Set message type number.
|
java.lang.String |
toString() |
java.lang.Object |
unmarshalObject(AOByteBuffer buf)
Internal use only.
|
static void |
writeObjectUtility(java.io.ObjectOutputStream out,
MessageType type)
Internal use only.
|
protected static java.util.Map<java.lang.String,MessageType> internedMsgTypes
protected transient java.lang.String msgTypeString
protected transient java.lang.Integer msgTypeNumber
public MessageType()
protected MessageType(java.lang.String msgTypeString)
public int getMsgTypeNumber()
public void setMsgTypeNumber(int msgTypeNumber)
MessageCatalog to assign a number.public java.lang.String getMsgTypeString()
public static MessageType intern(java.lang.String typeName)
public java.lang.String toString()
toString in class java.lang.Objectpublic static MessageType readObjectUtility(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException
java.io.IOExceptionjava.lang.ClassNotFoundExceptionpublic static void writeObjectUtility(java.io.ObjectOutputStream out,
MessageType type)
throws java.io.IOException,
java.lang.ClassNotFoundException
java.io.IOExceptionjava.lang.ClassNotFoundExceptionpublic void marshalObject(AOByteBuffer buf)
marshalObject in interface Marshallablebuf - The byte bufferpublic java.lang.Object unmarshalObject(AOByteBuffer buf)
unmarshalObject in interface Marshallable