Request
supports the Dynamic Invocation Interface (DII), whereby an application may issue a request for any interface, even if that interface was unknown at the time the application was compiled.OrbixWeb allows invocations, which are instances of class
Request
, to be constructed by specifying at runtime the target object reference, the operation name and the parameters. Such calls are termed "dynamic" because the IDL interfaces used by a program do not have to be "statically" determined at the time the program is designed and implemented.
// IDL pseudo interface Request { readonly attribute Object target; readonly attribute Identifier operation; readonly attribute NVList arguments; readonly attribute NamedValue result; readonly attribute Environment env; attribute Context ctx; Status invoke(); Status send_oneway(); Status send_deferred(); Status get_response(); boolean poll_response(); };
// Java package IE.Iona.Orbix2.CORBA; public class Request extends MarshalBuffer { // Constructors public Request(); public Request(IE.Iona.Orbix2.CORBA._ObjectRef target); public Request(IE.Iona.Orbix2.CORBA._ObjectRef target, String operationName); // Methods public static Request IT_create(); public static Request IT_create( IE.Iona.Orbix2.CORBA._ObjectRef target); public static Request IT_create( IE.Iona.Orbix2.CORBA._ObjectRef target, String operationName); public static Request _nil(); // Argument Methods public void reset(); public void reset( IE.Iona.Orbix2.CORBA._ObjectRef target); public void reset(String operationName); public void reset(IE.Iona.Orbix2.CORBA._ObjectRef target, String operationName); public int add_arg(String name, Any a, Flags arg_flags) throws SystemException; public Flags argFlags(); public void setArgFlags(Flags arg_flags); public void setArgFlags(int arg_flags); // Insert Methods public void insertShort(short s) throws SystemException; public void insertShort(ShortHolder s) throws SystemException; public void insertLong(int l) throws SystemException; public void insertLong(IntHolder l) throws SystemException; public void insertUShort(short s) throws SystemException; public void insertUShort(ShortHolder s) throws SystemException; public void insertULong(int l) throws SystemException; public void insertULong(IntHolder l) throws SystemException; public void insertFloat(float f) throws SystemException; public void insertFloat(FloatHolder f) throws SystemException; public void insertDouble(double d) throws SystemException; public void insertDouble(DoubleHolder d) throws SystemException; public void insertChar(char c) throws SystemException; public void insertChar(CharHolder c) throws SystemException; public void insertOctet(byte b) throws SystemException; public void insertOctet(ByteHolder b) throws SystemException; public void insertString(String s) throws SystemException; public void insertString(StringHolder s) throws SystemException; public void insertString(String s, int length) throws SystemException; public void insertString(StringHolder s, int length) throws SystemException; public void insertBoolean(boolean b) throws SystemException; public void insertBoolean(BooleanHolder b) throws SystemException; public void insertAny(Any a) throws SystemException; public void insertTypeCode(TypeCode tc) throws SystemException; public void insertObject( IE.Iona.Orbix2.CORBA._ObjectRef oref) throws SystemException; public void insertObject( IE.Iona.Orbix2.CORBA._ObjectHolder horef) throws SystemException; public void insert(Marshalable m) throws SystemException; // Array Insert Methods public void insertShortArray(short s[], int length) throws SystemException; public void insertLongArray(int l[], int length) throws SystemException; public void insertUShortArray(short s[], int length) throws SystemException; public void insertULongArray(int l[], int length) throws SystemException; public void insertFloatArray(float f[], int length) throws SystemException; public void insertDoubleArray(double d[], int length) throws SystemException; public void insertCharArray(char c[], int length) throws SystemException; public void insertOctetArray(byte b[], int length) throws SystemException; public void insertStringArray(String s[], int length) throws SystemException; public void insertBooleanArray(boolean b[], int length) throws SystemException; public void insertAnyArray(Any a[], int length) throws SystemException; public void insertTypeCodeArray(TypeCode tc[], int length) throws SystemException; public void insertObjectArray( IE.Iona.Orbix2.CORBA._ObjectRef oref[], int length) throws SystemException; public void insertArray(Marshalable m[], int length) throws SystemException; // Extract Methods public short extractShort() throws SystemException; public int extractLong() throws SystemException; public short extractUShort() throws SystemException; public int extractULong() throws SystemException; public float extractFloat() throws SystemException; public double extractDouble() throws SystemException; public char extractChar() throws SystemException; public byte extractOctet() throws SystemException; public String extractString() throws SystemException; public boolean extractBoolean() throws SystemException; public Any extractAny() throws SystemException; public TypeCode extractTypeCode() throws SystemException; public IE.Iona.Orbix2.CORBA._ObjectRef extractObject() throws SystemException; public void extract(Marshalable m) throws SystemException; // Array Extract Methods public int extractShortArray(short s[], int length) throws SystemException; public int extractLongArray(int l[],int length) throws SystemException; public int extractUShortArray(short s[],int length) throws SystemException; public int extractULongArray(int l[],int length) throws SystemException; public int extractFloatArray(float f[],int length) throws SystemException; public int extractDoubleArray(double d[],int length) throws SystemException; public int extractCharArray(char c[],int length) throws SystemException; public int extractOctetArray(byte b[],int length) throws SystemException; public int extractStringArray(String s[], int length) throws SystemException; public int extractBooleanArray(boolean b[],int length) throws SystemException; public int extractAnyArray(Any a[], int length) throws SystemException; public int extractTypeCodeArray(TypeCode tc[], int length) throws SystemException; public int extractObjectArray( IE.Iona.Orbix2.CORBA._ObjectRef oref[], int length) throws SystemException; public int extractArray(Marshalable m[],int length) throws SystemException; // Extraction method for out and inout values public void extractOutParams() throws SystemException; // Invocation Methods public int invoke() throws CORBAException; public int send_deferred() throws CORBAException; public int send_oneway() throws CORBAException; public int get_response() throws CORBAException; public boolean poll_response() throws CORBAException; // Exception Methods public boolean isException(); public CORBAException _getException(); // Filter Enable Method public boolean inReplyPostMarshal() throws CORBAException; // Data Accessor Methods public String operation(); public void setOperation(String operationName); public IE.Iona.Orbix2.CORBA._ObjectRef target(); public void setTarget( IE.Iona.Orbix2.CORBA._ObjectRef target); public NVList arguments() throws SystemException; public Context ctx(); public void ctx(Context c); public NamedValue result() throws SystemException; public void setTypeCode(TypeCode tc) throws SystemException; }
public Request();
CORBA.BaseObject._create_request()
and CORBA.BaseObject._request()
for CORBA defined ways of constructing a Request
.
CORBA.BaseObject._create_request()
CORBA.BaseObject._request()
CORBA.Request.IT_create()
Other Request
constructors.
public Request(IE.Iona.Orbix2.CORBA._ObjectRef target);
Request
by specifying its target object's reference. The operation name for the request may be set using CORBA.Request.setOperation()
.
|
The object which is the target of the request.
|
CORBA.BaseObject._create_request()
and CORBA.BaseObject._request()
for CORBA defined ways of constructing a Request
.
CORBA.BaseObject._create_request()
CORBA.BaseObject._request()
CORBA.Request.setOperation()
CORBA.Request.IT_create()
Other Request
constructors.
public Request(IE.Iona.Orbix2.CORBA._ObjectRef target,
String operationName);
Request
by specifying its target object's reference and the required operation name.
|
The object which is the target of the request.
|
|
The operation name for the request.
|
CORBA.BaseObject._create_request()
and CORBA.BaseObject._request()
for CORBA defined ways of constructing a Request
.
CORBA.BaseObject._create_request()
CORBA.BaseObject._request()
CORBA.Request.setOperation()
CORBA.Request.IT_create()
Other Request
constructors.
public short extractShort()
throws SystemException;
public int extractLong()
throws SystemException;
public short extractUShort()
throws SystemException;
public int extractULong()
throws SystemException;
public float extractFloat()
throws SystemException;
public double extractDouble()
throws SystemException;
public char extractChar()
throws SystemException;
public byte extractOctet()
throws SystemException;
public String extractString()
throws SystemException;
public boolean extractBoolean()
throws SystemException;
public Any extractAny()
throws SystemException;
public TypeCode extractTypeCode()
throws SystemException;
public IE.Iona.Orbix2.CORBA._ObjectRef extractObject()
throws SystemException;
public void extract(Marshalable m)
throws SystemException;
Request
. The inout
and out
parameter values should be extracted from the Request
using the method Request.extractOutParams()
.Each extraction method returns a value of the required type. The target variable does not need to be preallocated before calling a single-element
extract()
method.
Request
was invoked.
CORBA.Request.insert()
CORBA.Request.extractOutParams()
public int extractShortArray(short s[], int length) throws SystemException; public int extractLongArray(int l[],int length) throws SystemException; public int extractUShortArray(short s[],int length) throws SystemException; public int extractULongArray(int l[],int length) throws SystemException; public int extractFloatArray(float f[],int length) throws SystemException; public int extractDoubleArray(double d[],int length) throws SystemException; public int extractCharArray(char c[],int length) throws SystemException; public int extractOctetArray(byte b[],int length) throws SystemException; public int extractStringArray(String s[], int length) throws SystemException; public int extractBooleanArray(boolean b[],int length) throws SystemException; public int extractAnyArray(Any a[], int length) throws SystemException; public int extractTypeCodeArray(TypeCode tc[], int length) throws SystemException; public int extractObjectArray( IE.Iona.Orbix2.CORBA._ObjectRef oref[], int length) throws SystemException; public int extractArray(Marshalable m[],int length) throws SystemException;
Request
. The inout
and out
parameter values should be extracted from the Request
using the method Request.extractOutParams()
.Each array extraction method takes a preallocated array as a parameter and an
int
parameter which indicates the length of the array. If the array is not large enough to hold the operation return value, then an exception is raised. Otherwise, the array elements are modified and the actual length of the array is returned.
CORBA.Request.insertArray()
CORBA.Request.extractOutParams()
public void extractOutParams() throws SystemException;
inout
and out
parameter values from a Request
. Updates the values of variables which were previously inserted into the Request
.
CORBA.Request.extract()
CORBA.Request.extractArray()
public boolean inReplyPostMarshal() throws CORBAException;
CORBA.Filter.inReplyPostMarshal()
for the current Request
. This is required when invoking a Request
with the DII, as the CORBA.Filter.inReplyPostMarshal()
will not be automatically invoked for a dynamic request.
CORBA.Filter
public void insertShort(short s)
throws SystemException;
public void insertShort(ShortHolder s)
throws SystemException;
public void insertLong(int l)
throws SystemException;
public void insertLong(IntHolder l)
throws SystemException;
public void insertUShort(short s)
throws SystemException;
public void insertUShort(ShortHolder s)
throws SystemException;
public void insertULong(int l)
throws SystemException;
public void insertULong(IntHolder l)
throws SystemException;
public void insertFloat(float f)
throws SystemException;
public void insertFloat(FloatHolder f)
throws SystemException;
public void insertDouble(double d)
throws SystemException;
public void insertDouble(DoubleHolder d)
throws SystemException;
public void insertChar(char c)
throws SystemException;
public void insertChar(CharHolder c)
throws SystemException;
public void insertOctet(byte b)
throws SystemException;
public void insertOctet(ByteHolder b)
throws SystemException;
public void insertString(String s)
throws SystemException;
public void insertString(StringHolder s)
throws SystemException;
public void insertString(String s, int length)
throws SystemException;
public void insertString(StringHolder s, int length)
throws SystemException;
public void insertBoolean(boolean b)
throws SystemException;
public void insertBoolean(BooleanHolder b)
throws SystemException;
public void insertAny(Any a)
throws SystemException;
public void insertTypeCode(TypeCode tc)
throws SystemException;
public void insertObject(
IE.Iona.Orbix2.CORBA._ObjectRef oref)
throws SystemException;
public void insertObject(
IE.Iona.Orbix2.CORBA._ObjectHolder horef)
throws SystemException;
public void insert(Marshalable m)
throws SystemException;
Request
. There are two forms of each insertion method: a method which supports the insertion of in
parameters, and a method which supports the insertion of inout
or out
parameters. The first method form takes a single parameter of the appropriate type; the second takes a Holder
object for the type.The parameter passing mode should be set for the parameter using the method
Request.setArgFlags()
. This should be done immediately before inserting the parameter into the Request
.The following example inserts a
short
inout
parameter into a Request
:
// Java Request r; ... short ioShort = 50; ShortHolder ioHolder = new ShortHolder (ioShort); r.setArgFlags (_CORBA.ARG_INOUT); r.insertShort (ioHolder);
CORBA.Request.extract()
public void insertShortArray(short s[], int length)
throws SystemException;
public void insertLongArray(int l[], int length)
throws SystemException;
public void insertUShortArray(short s[], int length)
throws SystemException;
public void insertULongArray(int l[], int length)
throws SystemException;
public void insertFloatArray(float f[], int length)
throws SystemException;
public void insertDoubleArray(double d[], int length)
throws SystemException;
public void insertCharArray(char c[], int length)
throws SystemException;
public void insertOctetArray(byte b[], int length)
throws SystemException;
public void insertStringArray(String s[], int length)
throws SystemException;
public void insertBooleanArray(boolean b[], int length)
throws SystemException;
public void insertAnyArray(Any a[], int length)
throws SystemException;
public void insertTypeCodeArray(TypeCode tc[],
int length)
throws SystemException;
public void insertObjectArray(
IE.Iona.Orbix2.CORBA._ObjectRef oref[],
int length)
throws SystemException;
public void insertArray(Marshalable m[], int length)
throws SystemException;
Request
. Each insertion method takes an array parameter of the appropriate type and an int
parameter which indicates the length of the array.The parameter passing mode should be set for the parameter using the method
Request.setArgFlags()
. This should be done immediately before inserting the parameter into the Request
.The following example inserts a
short
array in
parameter of length five into a Request
:
// Java Request r; ... short[] iShortAr = new short[5]; ... r.setArgFlags (_CORBA.ARG_IN); r.insertShortArray (iShortAr, 5);
CORBA.Request.extractArray()
public static Request _nil();
Request
.
_CORBA.is_nil()
public NVList arguments()
throws SystemException;
Request
's operation in an NVList
.
CORBA.NVList
public Context ctx();
Context
associated with a request.
CORBA.Request.ctx()
CORBA.Context
public void ctx(Context c);
Context
into a request.
CORBA.Request.ctx();
CORBA.Context
public int get_response()
throws CORBAException;
send_deferred()
) has completed. If the return value indicates success, the out
and inout
parameters and return values defined in the Request
are valid.
1
if the Request
completed successfully; returns 0
otherwise.
CORBA.Request.result() CORBA.Request.send_deferred()
public int invoke() throws CORBAException;
To make a non-blocking request, see
CORBA.Request.send_deferred()
and CORBA.Request.send_oneway()
.
1
if successful, 0
otherwise.
CORBA.Request.send_oneway()
CORBA.Request.send_deferred()
CORBA.Request.result()
public static Request IT_create(); public static Request IT_create( IE.Iona.Orbix2.CORBA._ObjectRef target); public static Request IT_create( IE.Iona.Orbix2.CORBA._ObjectRef target, String operationName);
IT_create()
method for class Request
.See the corresponding constructor for details of the parameters to
IT_create()
.
CORBA.BaseObject._create_request()
and CORBA.BaseObject._request()
for CORBA defined ways of creating a Request
.
CORBA.BaseObject._create_request() CORBA.BaseObject._request()
Request
constructors.
public String operation();
Request
's operation name.
CORBA.Request.setOperation()
public boolean poll_response()
throws CORBAException;
send_deferred()
may call poll_response()
to determine whether the operation has completed. The method returns immediately. If the operation has completed, the result is available in the Request
.
true
if the operation has completed successfully indicating that the return value and out
and inout
parameters in the Request
are valid; returns false
otherwise.
CORBA.
Request.send_oneway()
CORBA.
Request.send_deferred()
CORBA.
Request.get_response()
CORBA.ORB.poll_next_response()
public void reset();
public void reset(
IE.Iona.Orbix2.CORBA._ObjectRef target);
public void reset(String operationName);
public void reset(IE.Iona.Orbix2.CORBA._ObjectRef target,
String operationName);
Request
object to be reused. The target object and/or the operation name can be individually reset.
target |
The target object. (If set to null , the target object is not reset.)
|
operationName |
The operation name.
|
public NamedValue result()
throws SystemException;
NamedValue
.
CORBA.Request.extract()
public int send_deferred()
throws CORBAException;
The caller can use the method
CORBA.Request.poll_response()
to determine whether the operation completed.The method
CORBA.Request.get_response()
can be used to determine the outcome of the request. Memory leakage will result if this method is not called for a request issued with send_deferred()
.To make a blocking request, see
CORBA.Request.invoke()
.
1
if successful, 0
otherwise.
CORBA.
Request.send_oneway()
CORBA.ORB.send_multiple_requests_deferred()
CORBA.Request.invoke()
CORBA.Request.poll_response()CORBA.
Request.get_response()
public int send_oneway()
throws CORBAException;
This method may be used even if the operation has not been defined to be
oneway
in its IDL definition. The caller should not expect any in
or inout
parameters to be updated. To make a blocking request, see
CORBA.Request.invoke()
.
1
if successful, 0
otherwise.
CORBA.
Request.send_deferred
CORBA.ORB.send_multiple_requests_oneway()
CORBA.Request.invoke()
CORBA.Request.poll_response()CORBA.
Request.get_response()
public void setOperation(String operationName);
CORBA.Request.operation()
CORBA.Request._create_request()
CORBA.Request._request()
public void setTarget(
IE.Iona.Orbix2.CORBA._ObjectRef target);
Request
's target object.
CORBA.Request.target()
public IE.Iona.Orbix2.CORBA._ObjectRef target();
Request
's target object.
CORBA.Request.setTarget()