com.resilientedge.jockey.appcomm
Class Request

java.lang.Object
  |
  +--com.resilientedge.jockey.appcomm.AbstractMarshallable
        |
        +--com.resilientedge.jockey.appcomm.Request
All Implemented Interfaces:
Marshallable, java.io.Serializable

public class Request
extends AbstractMarshallable
implements java.io.Serializable

A request object to be sent to the jockey engine.

Version:
$Revision: 1.1.1.1 $
Author:
John Gardner
See Also:
Serialized Form

Fields inherited from interface com.resilientedge.jockey.appcomm.Marshallable
FAILED, SUCCESS, TYPE_FIXED_STRING, TYPE_OBJECT, TYPE_UINT_32
 
Constructor Summary
Request()
          Basic constructor.
Request(java.lang.Class toCall, java.lang.String howToCall, java.lang.String methodName, java.lang.Object[] args)
          Useful constructor for void calls.
Request(java.lang.Class toCall, java.lang.String howToCall, java.lang.String methodName, java.lang.Object[] args, java.lang.Class returnType)
          Useful constructor.
Request(java.lang.String nameToCall, java.lang.String howToCall, java.lang.String methodName, java.lang.Object[] args, java.lang.Class returnType)
          Useful constructor.
 
Method Summary
 int fromBytes(byte[] buffer, int offset)
          Reinitialize this object from the contents of an array of bytes.
 java.lang.Object[] getArgs()
          Return the arguments to the request
 java.lang.String getHowToCall()
          Return the call method used to obtain the object that must satisfy this request.
 java.lang.String getMarshalName()
          Return an identifier for this object.
 int getMarshalSize()
          Return the number of bytes that this object would require to marshal itself.
 java.lang.String getMethodName()
          Return the method name to be called on the object that must satisfy this request.
 java.lang.String getNameToCall()
          Return the name of the object that must satisfy this request.
 java.lang.String getReturnType()
          Return the return type expected for this request.
 int toBytes(byte[] buffer, int offset)
          Marshal this object to a language independent array of bytes.
 
Methods inherited from class com.resilientedge.jockey.appcomm.AbstractMarshallable
getRealMarshalSize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Request

public Request()
Basic constructor.

Request

public Request(java.lang.Class toCall,
               java.lang.String howToCall,
               java.lang.String methodName,
               java.lang.Object[] args,
               java.lang.Class returnType)
Useful constructor.
Parameters:
toCall - the object on which a method will be called
howToCall - the mechanism to find the object to be called
methodName - the operation to invoke
args - arguments to the remote call
returnType - class of the return value expected

Request

public Request(java.lang.Class toCall,
               java.lang.String howToCall,
               java.lang.String methodName,
               java.lang.Object[] args)
Useful constructor for void calls. Does not pass a return value type definition.
Parameters:
toCall - the object on which a method will be called
howToCall - the mechanism to find the object to be called
methodName - the operation to invoke
args - arguments to the remote call

Request

public Request(java.lang.String nameToCall,
               java.lang.String howToCall,
               java.lang.String methodName,
               java.lang.Object[] args,
               java.lang.Class returnType)
Useful constructor.
Parameters:
nameToCall - name of the object on which a method will be called
howToCall - the mechanism to find the object to be called
methodName - the operation to invoke
args - arguments to the remote call
returnType - class of the return value expected
Method Detail

getMarshalName

public java.lang.String getMarshalName()
Return an identifier for this object. This has to be unique among marshallable objects. Currently, format is "PI" | "SI" "class-stem-name".
Returns:
name for this object.

toBytes

public int toBytes(byte[] buffer,
                   int offset)
Marshal this object to a language independent array of bytes.
Overrides:
toBytes in class AbstractMarshallable
Parameters:
buffer - a destination buffer to receive this object.
offset - begin marshalling at this offset from buffer start
Returns:
the number of bytes of the input buffer consumed.

fromBytes

public int fromBytes(byte[] buffer,
                     int offset)
Reinitialize this object from the contents of an array of bytes.
Overrides:
fromBytes in class AbstractMarshallable
Parameters:
buffer - a buffer containing the marshalled object.
offset - begin unmarshalling at this offset from buffer start
Returns:
the number of bytes of the input buffer consumed.

getMarshalSize

public int getMarshalSize()
Return the number of bytes that this object would require to marshal itself.
Overrides:
getMarshalSize in class AbstractMarshallable
Returns:
the number of bytes that this object would consume.

getNameToCall

public java.lang.String getNameToCall()
Return the name of the object that must satisfy this request.
Returns:
the object name

getHowToCall

public java.lang.String getHowToCall()
Return the call method used to obtain the object that must satisfy this request.
Returns:
how to call

getMethodName

public java.lang.String getMethodName()
Return the method name to be called on the object that must satisfy this request.
Returns:
how to call

getArgs

public java.lang.Object[] getArgs()
Return the arguments to the request
Returns:
array of objects

getReturnType

public java.lang.String getReturnType()
Return the return type expected for this request.
Returns:
class name of return type


Copyright © 2001 Resilient Edge, Inc. All Rights Reserved.