|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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 | |
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 |
createMsg(int msgType)
Create a BaseMsg subclass based on the msgType. |
boolean |
equals(Object o)
Equality is based on BaseMsg.msgID |
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(ObjectInputStream in)
Read the hasError flag and optionally the error. |
void |
run()
|
void |
setError(Throwable e)
Set an exception that should be used as the msg return value. |
void |
setHandler(SocketManager.ReadTask handler)
|
void |
setMsgID(int msgID)
Set the msgID. |
static void |
setUseJMSServerMsgIDs(boolean flag)
Set the msgID parameter range. |
String |
toString()
|
static String |
toString(int msgType)
Translate a msgType into its string menmonic. |
void |
trimReply()
Trim the message when replying |
void |
write(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 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 createMsg(int msgType) throws IllegalArgumentException
msgType
- A MsgTypes.m_xxx constant
IllegalArgumentException
- thrown for a msgType that does not
match any MsgTypes.m_xxx constantpublic static 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 Exception getError()
public void setError(Throwable e)
e
- public boolean equals(Object o)
o
- a BaseMsg
public int hashCode()
public String toString()
public void trimReply()
public void write(ObjectOutputStream out) throws IOException
out
-
IOException
public void read(ObjectInputStream in) throws IOException, ClassNotFoundException
in
-
IOException
ClassNotFoundException
public void setHandler(SocketManager.ReadTask handler)
public void run()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |