org.exolab.jms.net.connector
Class Request

java.lang.Object
  |
  +--org.exolab.jms.net.connector.Request
All Implemented Interfaces:
java.io.Serializable

public class Request
extends java.lang.Object
implements java.io.Serializable

A Request wraps all of the information needed to invoke a method on a remote object.

Version:
$Revision: 1.3 $ $Date: 2005/04/14 15:08:06 $
Author:
Tim Anderson
See Also:
Response, Connection, Serialized Form

Constructor Summary
Request(java.rmi.server.ObjID objID, java.lang.reflect.Method method, java.lang.Object[] args, long methodID)
          Construct a new Request.
 
Method Summary
 java.lang.Object[] getArgs()
          Returns the arguments to pass to the method.
 java.lang.reflect.Method getMethod()
          Returns the method to invoke.
 long getMethodID()
          Returns the unique identifier of the method to invoke.
 java.rmi.server.ObjID getObjID()
          Returns the object identifier.
 java.lang.String getURI()
          Returns the URI of the remote server.
static Request read(java.io.ObjectInput in)
          Read a request from a stream.
 java.lang.Object[] readArgs(java.lang.reflect.Method method)
          Reads the serialized arguments, using the supplied method to determine the argument types.
 void write(java.io.ObjectOutput out)
          Write this request to a stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Request

public Request(java.rmi.server.ObjID objID,
               java.lang.reflect.Method method,
               java.lang.Object[] args,
               long methodID)
Construct a new Request.
Parameters:
objID - the object to invoke the method on
method - the method to invoke
args - the arguments to pass to the method. May be null.
methodID - the unique identifier of the method
Method Detail

getURI

public java.lang.String getURI()
Returns the URI of the remote server.
Returns:
the URI of the remote server

getObjID

public java.rmi.server.ObjID getObjID()
Returns the object identifier.
Returns:
the object identifier

getMethod

public java.lang.reflect.Method getMethod()
Returns the method to invoke.
Returns:
the method to invoke

getArgs

public java.lang.Object[] getArgs()
Returns the arguments to pass to the method.
Returns:
the arguments to pass to the method, or null if the method doesn't take any arguments, or the arguments haven't yet been read via readArgs(java.lang.reflect.Method)

readArgs

public java.lang.Object[] readArgs(java.lang.reflect.Method method)
                            throws java.lang.ClassNotFoundException,
                                   java.io.IOException
Reads the serialized arguments, using the supplied method to determine the argument types.
Parameters:
method - the method
Returns:
the deserialized arguments
Throws:
java.lang.ClassNotFoundException - if an argument can't be deserialized
java.io.IOException - for any I/O error
See Also:
read(java.io.ObjectInput)

getMethodID

public long getMethodID()
Returns the unique identifier of the method to invoke.
Returns:
the identifier of the method to invoke

write

public void write(java.io.ObjectOutput out)
           throws java.io.IOException
Write this request to a stream.
Parameters:
out - the stream to write to
Throws:
java.io.IOException - for any I/O error

read

public static Request read(java.io.ObjectInput in)
                    throws java.io.IOException
Read a request from a stream.

This method doesn't completely deserialize the request. On return from this, the caller is responsible for invoking readArgs(java.lang.reflect.Method) with the method corresponding to that returned by getMethodID().

Parameters:
in - the stream to read from. This is responsible for its closure.
Returns:
the deserialized request
Throws:
java.io.IOException - for any I/O error


Copyright © 1999-2007 The OpenJMS Group. All Rights Reserved.