|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--osl.handler.RequestMsg
This class encodes a message sent between request handler sessions. The fields in this class indicate whether or not a message represents a request, a reply to a request (e.g. for RPC requests), or an exception caused by a request which should be delivered back to the calling client. Custom serialization routines are implemented for efficiency purposes. Note that the only information we include about the parties involved in the request is the Name of the sender. The reason is that request messages are transmitted via TransportMessages, which already include sender and receiver PhysicalAddresses. Including that information here would result in transmitting (and worse, serializing) duplicate information.
RequestHandler, Serialized Form| Constructor Summary | |
RequestMsg()
The default constructor sets the message type as UNKNOWN with no id and no return value. |
|
RequestMsg(java.lang.Object rVal,
long msgID,
int mType,
RequestMsg oReq)
This constructor useful for building a reply to an RPC request or for returning an exception given the original request message, the id of the reply, and the value to send as the reply. |
|
RequestMsg(PhysicalAddress oSend,
Name dName,
int theType,
long theId,
long theSrcID,
java.lang.Object theRVal,
java.lang.String target,
java.lang.Object[] theArgs,
long[] rGC,
java.lang.String cName,
byte[] cData)
This is the full version of the RequestMsg constructor. |
|
RequestMsg(PhysicalAddress oSender,
Name dest,
int type,
java.lang.String targMeth,
java.lang.Object[] theArgs,
long theID)
This constructor useful for building REQUESTS or RPC_REQUESTS. |
|
| Method Summary | |
void |
readExternal(java.io.ObjectInput in)
Deserialize into a new instnace of RequestMesg by reading from the given input stream. |
void |
writeExternal(java.io.ObjectOutput out)
Serialize the contents of this class to the output stream. |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Constructor Detail |
public RequestMsg(PhysicalAddress oSend,
Name dName,
int theType,
long theId,
long theSrcID,
java.lang.Object theRVal,
java.lang.String target,
java.lang.Object[] theArgs,
long[] rGC,
java.lang.String cName,
byte[] cData)
oSend - The PhysicalAddress of the original
sender of this message. We need this data so that replies are
correctly routed in the case of forwarded requests.dName - The Name of the receiver.theType - The int type of this message.theId - The int ID for this message. Should
be unique relative to the sender.theSrcID - In the case of an RPC reply, the
int id of the original request message.theRVal - In the case of an RPC reply, the
Object which holds the returned value. In the case of
an exception, the Exception which was returned by the
receiver. This will either be a RemoteException or a
NoSuchMethodException.target - The String naming the method to
invoke on the receiver.theArgs - An object array (i.e. Object[])
giving the arguments to pass to the target method.
public RequestMsg(PhysicalAddress oSender,
Name dest,
int type,
java.lang.String targMeth,
java.lang.Object[] theArgs,
long theID)
oSender - The PhysicalAddress of the
original sender of the message.dest - The Name of the receiver.type - The type of the message. Will usually be
either MTYPE_REQUEST or MTYPE_RPC_REQUEST.targMeth - A String naming the method to
invoke on the target.theArgs - The object array holding the arguments to
pass to the target method.theId - The integer ID of this message. Should be
unique relative to the sender.
public RequestMsg(java.lang.Object rVal,
long msgID,
int mType,
RequestMsg oReq)
rVal - The object to send as the return value for the
original request.msgID - The id of the reply message. Should be
unique relative to the sender.mType - The type of reply: either MTYPE_RPC_REPLY or
MTYPE_RPC_EXCEPTION.oReq - The original request message.public RequestMsg()
| Method Detail |
public void writeExternal(java.io.ObjectOutput out)
throws java.io.IOException,
RequestException
out - The OutputStream to which we should
write this instance.
public void readExternal(java.io.ObjectInput in)
throws java.io.IOException,
java.lang.ClassNotFoundException,
java.lang.ClassCastException,
RequestException
in - The InputStream from which we should
deserialize this instance.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||