|
||||||||||
PREV CLASS (src) NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.mq.il.uil2.msgs.BaseMsg
The base msg class for all msgs used by the UIL2 invoker. Msgs consist of a msg type, id and exception and can operate as two way items that are sent with the request content and received with the reply content for the request. Such round-trip behavior is based on matching the request msgID with the reply msgID. The msgID parameter is segmented into value 1 to 2147483647 for client originated msgs and -1 to -2147483647 for server originated msgs.
The message is a Runnable to avoid constructing a Runnable object when asynchronously handling the message from the ReadTask.
Field Summary | |
java.lang.Exception |
error
Any error thrown by the remote side |
int |
msgID
A msg id used to associated a reply with its request |
int |
msgType
The MsgTypes constant representing the type of the msg |
Constructor Summary | |
BaseMsg(int msgType)
|
|
BaseMsg(int msgType,
int msgID)
|
Method Summary | |
static BaseMsg (src) |
createMsg(int msgType)
Create a BaseMsg subclass based on the msgType. |
boolean |
equals(java.lang.Object o)
Equality is based on BaseMsg.msgID |
java.lang.Exception |
getError()
Access any exception associated with the msg |
int |
getMsgID()
Access the msgID, initializing it if it has not been set yet. |
int |
getMsgType()
|
int |
hashCode()
Hash code is simply the msgID |
void |
read(java.io.ObjectInputStream in)
Read the hasError flag and optionally the error. |
void |
run()
|
void |
setError(java.lang.Throwable e)
Set an exception that should be used as the msg return value. |
void |
setHandler(SocketManager.ReadTask (src) handler)
|
void |
setMsgID(int msgID)
Set the msgID. |
static void |
setUseJMSServerMsgIDs(boolean flag)
Set the msgID parameter range. |
java.lang.String |
toString()
|
static java.lang.String |
toString(int msgType)
Translate a msgType into its string menmonic. |
void |
trimReply()
Trim the message when replying |
void |
write(java.io.ObjectOutputStream out)
Write the msgType, msgID, hasError flag and optionally the error |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
public int msgType
public int msgID
public java.lang.Exception error
Constructor Detail |
public BaseMsg(int msgType)
public BaseMsg(int msgType, int msgID)
Method Detail |
public static void setUseJMSServerMsgIDs(boolean flag)
flag
- public static BaseMsg (src) createMsg(int msgType) throws java.lang.IllegalArgumentException
msgType
- A MsgTypes.m_xxx constant
java.lang.IllegalArgumentException
- thrown for a msgType that does not
match any MsgTypes.m_xxx constantpublic static java.lang.String toString(int msgType)
msgType
- A MsgTypes.m_xxx constant
public int getMsgType()
public int getMsgID()
public void setMsgID(int msgID)
msgID
- the msgID read off the socketpublic java.lang.Exception getError()
public void setError(java.lang.Throwable e)
e
- public boolean equals(java.lang.Object o)
o
- a BaseMsg
public int hashCode()
public java.lang.String toString()
public void trimReply()
public void write(java.io.ObjectOutputStream out) throws java.io.IOException
out
-
java.io.IOException
public void read(java.io.ObjectInputStream in) throws java.io.IOException, java.lang.ClassNotFoundException
in
-
java.io.IOException
java.lang.ClassNotFoundException
public void setHandler(SocketManager.ReadTask (src) handler)
public void run()
run
in interface java.lang.Runnable
|
||||||||||
PREV CLASS (src) NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |