| java.lang.Object org.jboss.mq.il.uil2.msgs.BaseMsg
All known Subclasses: org.jboss.mq.il.uil2.msgs.TemporaryDestMsg, org.jboss.mq.il.uil2.msgs.ReceiveRequestMsg, org.jboss.mq.il.uil2.msgs.CheckIDMsg, org.jboss.mq.il.uil2.msgs.ConnectionTokenMsg, org.jboss.mq.il.uil2.msgs.ReceiveMsg, org.jboss.mq.il.uil2.msgs.CreateDestMsg, org.jboss.mq.il.uil2.msgs.TransactMsg, org.jboss.mq.il.uil2.msgs.DeleteTemporaryDestMsg, org.jboss.mq.il.uil2.msgs.BrowseMsg, org.jboss.mq.il.uil2.msgs.GetIDMsg, org.jboss.mq.il.uil2.msgs.PingMsg, org.jboss.mq.il.uil2.msgs.CheckUserMsg, org.jboss.mq.il.uil2.msgs.EnableConnectionMsg, org.jboss.mq.il.uil2.msgs.AcknowledgementRequestMsg, org.jboss.mq.il.uil2.msgs.SubscribeMsg, org.jboss.mq.il.uil2.msgs.DeleteSubscriptionMsg, org.jboss.mq.il.uil2.msgs.RecoverMsg, org.jboss.mq.il.uil2.msgs.CloseMsg, org.jboss.mq.il.uil2.msgs.UnsubscribeMsg, org.jboss.mq.il.uil2.msgs.AddMsg,
BaseMsg | public class BaseMsg implements Runnable(Code) | | 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.
author: Scott.Stark@jboss.org author: Adrian.Brock@HappeningTimes.com version: $Revision: 57198 $ |
Constructor Summary | |
public | BaseMsg(int msgType) | public | BaseMsg(int msgType, int msgID) |
msgID | public int msgID(Code) | | A msg id used to associated a reply with its request
|
msgType | public int msgType(Code) | | The MsgTypes constant representing the type of the msg
|
BaseMsg | public BaseMsg(int msgType)(Code) | | |
BaseMsg | public BaseMsg(int msgType, int msgID)(Code) | | |
createMsg | public static BaseMsg createMsg(int msgType) throws IllegalArgumentException(Code) | | Create a BaseMsg subclass based on the msgType.
Parameters: msgType - A MsgTypes.m_xxx constant the derived BaseMsg throws: IllegalArgumentException - thrown for a msgType that does notmatch any MsgTypes.m_xxx constant |
equals | public boolean equals(Object o)(Code) | | Equality is based on BaseMsg.msgID
Parameters: o - a BaseMsg true if o.msgID == msgID |
getError | public Exception getError()(Code) | | Access any exception associated with the msg
|
getMsgID | public synchronized int getMsgID()(Code) | | Access the msgID, initializing it if it has not been set yet. This
is used by the SocketManager.internalSendMessage to setup the unique
msgID for a request msg.
the msgID value |
getMsgType | public int getMsgType()(Code) | | |
hashCode | public int hashCode()(Code) | | Hash code is simply the msgID
|
setError | public void setError(Throwable e)(Code) | | Set an exception that should be used as the msg return value.
Parameters: e - |
setHandler | public void setHandler(ReadTask handler)(Code) | | |
setMsgID | public void setMsgID(int msgID)(Code) | | Set the msgID. This is used by the SocketManager read task to populate
a msg with its request ID.
Parameters: msgID - the msgID read off the socket |
setUseJMSServerMsgIDs | public static void setUseJMSServerMsgIDs(boolean flag)(Code) | | Set the msgID parameter range. If false, the msgID is segmented into the
range 1 to 2147483647 and if true, the rangs is -1 to -2147483647. The
JMS server sets this to true and clients default to false.
Parameters: flag - |
toString | public static String toString(int msgType)(Code) | | Translate a msgType into its string menmonic.
Parameters: msgType - A MsgTypes.m_xxx constant the string form of the MsgTypes.m_xxx constant |
trimReply | public void trimReply()(Code) | | Trim the message when replying
|
|
|