com.ibm.ulc.comm
Class ORBRequest

java.lang.Object
  |
  +--com.ibm.ulc.util.UlcObject
        |
        +--com.ibm.ulc.comm.Request
              |
              +--com.ibm.ulc.comm.ORBRequest

public class ORBRequest
extends Request

Encapsulates a request for a registered object. An ORBRequests consists of a target object id, a request name, and arguments.

See Also:
Serialized Form

Field Summary
protected  ORBConnection fConnection
           
protected  Anything fData
           
protected  IAnythingWriter fWriter
           
 
Constructor Summary
ORBRequest(IAnythingWriter writer, int oid, java.lang.String request, Anything args)
          Creates a request for the given target.
ORBRequest(IAnythingWriter writer, int oid, java.lang.String request, Anything args, long contextId)
          Creates a request for the given target.
ORBRequest(ORBConnection conn)
          Creates a request and associates with the given connection.
 
Method Summary
 void dispatch()
          Executes the request by looking up the target object in the associated object space.
 void dump(java.io.OutputStream os)
          Pretty print the request to the given output stream.
 int getByteCount()
          Gets the number of bytes a request will take up when streamed.
 Anything getData()
          This method was created in VisualAge.
 java.lang.String getName()
          Get the name of this request.
 int getReplyId()
          Returns the id of the request that triggered this request or -1 if undefined.
 int getRequestId()
          Returns the unique id of this request within the active connection's life cycle.
 boolean read(java.io.InputStream is)
          Reads a request from the given stream.
 boolean readEx(java.io.InputStream is)
          Reads a request from the given stream.
 void setReplyId(int replyId)
          Sets the id of the request that triggered this request.
 void setRequestId(int reqId)
          Sets the id of this request unique within the connection that it is running in.
 void write(java.io.OutputStream os)
          Write the request to the given output stream.
 void writeEx(java.io.OutputStream os)
          Write the request to the given output stream.
 
Methods inherited from class com.ibm.ulc.util.UlcObject
trouble, trouble2, trouble2Err, troubleErr
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fData

protected Anything fData

fConnection

protected ORBConnection fConnection

fWriter

protected IAnythingWriter fWriter
Constructor Detail

ORBRequest

public ORBRequest(ORBConnection conn)
Creates a request and associates with the given connection. This constructor is used for received requests. The request data is filled in by the read method.
See Also:
read(java.io.InputStream)

ORBRequest

public ORBRequest(IAnythingWriter writer,
                  int oid,
                  java.lang.String request,
                  Anything args)
Creates a request for the given target. This constructor is used for requests to be sent.

ORBRequest

public ORBRequest(IAnythingWriter writer,
                  int oid,
                  java.lang.String request,
                  Anything args,
                  long contextId)
Creates a request for the given target. This constructor is used for requests to be sent.
Method Detail

dispatch

public void dispatch()
Executes the request by looking up the target object in the associated object space.
Overrides:
dispatch in class Request

dump

public void dump(java.io.OutputStream os)
Pretty print the request to the given output stream. For debugging purposes only.
Overrides:
dump in class Request

getByteCount

public int getByteCount()
Gets the number of bytes a request will take up when streamed. This is used for debugging and monitoring purposes only.
Overrides:
getByteCount in class Request

getData

public Anything getData()
This method was created in VisualAge.
Returns:
com.ibm.ulc.util.Anything

getName

public java.lang.String getName()
Get the name of this request. For debugging only.
Overrides:
getName in class Request

getReplyId

public int getReplyId()
Returns the id of the request that triggered this request or -1 if undefined. This is used for debugging and monitoring purposes only.

getRequestId

public int getRequestId()
Returns the unique id of this request within the active connection's life cycle. This is used for debugging and monitoring purposes only.

read

public boolean read(java.io.InputStream is)
Reads a request from the given stream. Returns true on success; false on failure.
Overrides:
read in class Request

readEx

public boolean readEx(java.io.InputStream is)
               throws java.io.IOException
Reads a request from the given stream.
Overrides:
readEx in class Request

setReplyId

public void setReplyId(int replyId)
Sets the id of the request that triggered this request. This is used for debugging and monitoring purposes only.

setRequestId

public void setRequestId(int reqId)
Sets the id of this request unique within the connection that it is running in. This is used for debugging and monitoring purposes only.

write

public void write(java.io.OutputStream os)
Write the request to the given output stream. The streaming format is determined by fWriter.
Overrides:
write in class Request

writeEx

public void writeEx(java.io.OutputStream os)
             throws java.io.InterruptedIOException,
                    java.io.IOException
Write the request to the given output stream. The streaming format is determined by fWriter.
Overrides:
writeEx in class Request