|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectmultiverse.msgsys.MessageType
public class MessageType
Message type object. Message types have a name and a number. The
message number is assigned when the MessageType is added to a
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. Multiverse reserves all names beginning with "mv.".
| Field Summary | |
|---|---|
protected static Map<String,MessageType> |
internedMsgTypes
|
protected Integer |
msgTypeNumber
|
protected String |
msgTypeString
|
private static long |
serialVersionUID
|
| Constructor Summary | |
|---|---|
|
MessageType()
No argument constructor is needed for marshalling. |
protected |
MessageType(String msgTypeString)
|
| Method Summary | |
|---|---|
int |
getMsgTypeNumber()
Get message type number. |
String |
getMsgTypeString()
Get message type name. |
static MessageType |
intern(String typeName)
Get singleton MessageType instance for a message type name. |
void |
marshalObject(MVByteBuffer buf)
Internal use only. |
private void |
readObject(ObjectInputStream in)
|
static MessageType |
readObjectUtility(ObjectInputStream in)
Internal use only. |
private Object |
readResolve()
|
void |
setMsgTypeNumber(int msgTypeNumber)
Set message type number. |
String |
toString()
|
Object |
unmarshalObject(MVByteBuffer buf)
Internal use only. |
private void |
writeObject(ObjectOutputStream out)
|
static void |
writeObjectUtility(ObjectOutputStream out,
MessageType type)
Internal use only. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected static Map<String,MessageType> internedMsgTypes
protected transient String msgTypeString
protected transient Integer msgTypeNumber
private static final long serialVersionUID
| Constructor Detail |
|---|
public MessageType()
protected MessageType(String msgTypeString)
| Method Detail |
|---|
public int getMsgTypeNumber()
public void setMsgTypeNumber(int msgTypeNumber)
MessageCatalog to assign a number.
public String getMsgTypeString()
public static MessageType intern(String typeName)
public String toString()
toString in class Object
private void readObject(ObjectInputStream in)
throws IOException,
ClassNotFoundException
IOException
ClassNotFoundException
public static MessageType readObjectUtility(ObjectInputStream in)
throws IOException,
ClassNotFoundException
IOException
ClassNotFoundException
private Object readResolve()
throws ObjectStreamException
ObjectStreamException
private void writeObject(ObjectOutputStream out)
throws IOException,
ClassNotFoundException
IOException
ClassNotFoundException
public static void writeObjectUtility(ObjectOutputStream out,
MessageType type)
throws IOException,
ClassNotFoundException
IOException
ClassNotFoundExceptionpublic void marshalObject(MVByteBuffer buf)
marshalObject in interface Marshallablebuf - The byte bufferpublic Object unmarshalObject(MVByteBuffer buf)
unmarshalObject in interface Marshallable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||