|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectNdrObject
org.jinterop.dcom.core.JICallBuilder
public class JICallBuilder
Class used for setting up information such as [in]
,[out]
parameters and the method number for executing a call to the
COM server.
Sample Usage :-
JICallBuilder obj = new JICallBuilder();
obj.reInit();
obj.setOpnum(0); //0 based index, can be obtained from the IDL or the Type Library of COM server.
obj.addInParamAsString(new JIString("j-Interop Rocks !"), JIFlags.FLAG_NULL);
obj.addInParamAsInt(100, JIFlags.FLAG_NULL);
//handle is previously obtained IJIComObject
Object[] result = comObject.call(obj);
[out]
parameters can be added in a similar way.
obj.addOutParamAsType(JIVariant.class,JIFlags.FLAG_NULL);
obj.addOutParamAsObject(new JIPointer(Short.class,true),JIFlags.FLAG_NULL);
JICallObject
)Constructor Summary | |
---|---|
JICallBuilder()
Constructs a builder object. |
|
JICallBuilder(boolean dispatchNotSupported)
Constructs a builder object. |
Method Summary | |
---|---|
void |
addInParamAsArray(JIArray value,
int FLAGS)
Add [in] parameter as JIArray at the end of the Parameter list. |
void |
addInParamAsBoolean(boolean value,
int FLAGS)
Add [in] parameter as boolean at the end of the Parameter list. |
void |
addInParamAsCharacter(char value,
int FLAGS)
Add [in] parameter as char at the end of the Parameter list. |
void |
addInParamAsComObject(IJIComObject comObject,
int FLAGS)
Add [in] parameter as IJIComObject at the end of the Parameter list. |
void |
addInParamAsDouble(double value,
int FLAGS)
Add [in] parameter as double at the end of the Parameter list. |
void |
addInParamAsFloat(float value,
int FLAGS)
Add [in] parameter as float at the end of the Parameter list. |
void |
addInParamAsInt(int value,
int FLAGS)
Add [in] parameter as int at the end of the Parameter list. |
void |
addInParamAsObject(java.lang.Object value,
int FLAGS)
Add [in] parameter as Object at the end of the Parameter list. |
void |
addInParamAsPointer(JIPointer value,
int FLAGS)
Add [in] parameter as JIPointer at the end of the Parameter list. |
void |
addInParamAsShort(short value,
int FLAGS)
Add [in] parameter as short at the end of the Parameter list. |
void |
addInParamAsString(java.lang.String value,
int FLAGS)
Add [in] parameter as String at the end of the Parameter list. |
void |
addInParamAsStruct(JIStruct value,
int FLAGS)
Add [in] parameter as JIStruct at the end of the Parameter list. |
void |
addInParamAsUnsigned(IJIUnsigned value,
int FLAGS)
Add [in] parameter as IJIUnsigned at the end of the Parameter list. |
void |
addInParamAsUUID(java.lang.String value,
int FLAGS)
Add [in] parameter as String representation of UUID at the end of the Parameter list. |
void |
addInParamAsVariant(JIVariant value,
int FLAGS)
Add [in] parameter as JIVariant at the end of the Parameter list. |
void |
addOutParamAsObject(java.lang.Object outparam,
int FLAGS)
Add [out] parameter at the end of the out parameter list. |
void |
addOutParamAsType(java.lang.Class clazz,
int FLAGS)
Add [out] parameter of the type clazz at the end of the out parameter list. |
int |
getHRESULT()
Returns the HRESULT of this operation. |
java.lang.Object |
getInParamAt(int index)
Returns [in] parameter at the specified index from the Parameter list. |
java.lang.Integer[] |
getInparamFlags()
Returns the In Param flag. |
java.lang.Object[] |
getInParams()
Returns the entire [in] parameters list. |
int |
getOpnum()
Returns the opnum of the API which will be invoked at the COM server. |
java.lang.Object |
getOutParamAt(int index)
Retrieves the [out] param at the index in the out parameters list. |
java.lang.Integer[] |
getOutparamFlags()
Returns the Out Param flag. |
java.lang.Object[] |
getOutParams()
Returns the entire [out] parameters list. |
JIArray |
getResultAsArrayAt(int index)
Returns the value as JIArray at the index from the result list. |
boolean |
getResultAsBooleanAt(int index)
Returns the value as boolean at the index from the result list. |
char |
getResultAsCharacterAt(int index)
Returns the value as char at the index from the result list. |
double |
getResultAsDoubleAt(int index)
Returns the value as double at the index from the result list. |
float |
getResultAsFloatAt(int index)
Returns the value as float at the index from the result list. |
int |
getResultAsIntAt(int index)
Returns the value as int at the index from the result list. |
JIPointer |
getResultAsPointerAt(int index)
Returns the value as JIPointer at the index from the result list. |
short |
getResultAsShortAt(int index)
Returns the value as short at the index from the result list. |
JIString |
getResultAsStringAt(int index)
Returns the value as JIString at the index from the result list. |
JIStruct |
getResultAsStructAt(int index)
Returns the value as JIStruct at the index from the result list. |
java.lang.String |
getResultAsUUIDStrAt(int index)
Returns the value as String representation of the UUID at the index from the result list. |
JIVariant |
getResultAsVariantAt(int index)
Returns the value as JIVariant at the index from the result list. |
java.lang.Object[] |
getResults()
Returns the results as an Object[] . |
java.lang.Object[] |
getResultsInCaseOfException()
Returns the results incase an exception occured. |
void |
insertInParamAsArrayAt(int index,
JIArray value,
int FLAGS)
Add [in] parameter as JIArray at the specified index in the Parameter list. |
void |
insertInParamAsBooleanAt(int index,
boolean value,
int FLAGS)
Add [in] parameter as boolean at the specified index in the Parameter list. |
void |
insertInParamAsCharacterAt(int index,
char value,
int FLAGS)
Add [in] parameter as char at the specified index in the Parameter list. |
void |
insertInParamAsComObjectAt(int index,
IJIComObject value,
int FLAGS)
Add [in] parameter as IJIComObject at the specified index in the Parameter list. |
void |
insertInParamAsDoubleAt(int index,
double value,
int FLAGS)
Add [in] parameter as double at the specified index in the Parameter list. |
void |
insertInParamAsFloatAt(int index,
float value,
int FLAGS)
Add [in] parameter as float at the specified index in the Parameter list. |
void |
insertInParamAsIntAt(int index,
int value,
int FLAGS)
Add [in] parameter as int at the specified index in the Parameter list. |
void |
insertInParamAsObjectAt(int index,
java.lang.Object value,
int FLAGS)
Add [in] parameter as Object at the specified index in the Parameter list. |
void |
insertInParamAsPointerAt(int index,
JIPointer value,
int FLAGS)
Add [in] parameter as JIPointer at the specified index in the Parameter list. |
void |
insertInParamAsShortAt(int index,
short value,
int FLAGS)
Add [in] parameter as short at the specified index in the Parameter list. |
void |
insertInParamAsStringAt(int index,
java.lang.String value,
int FLAGS)
Add [in] parameter as String at the specified index in the Parameter list. |
void |
insertInParamAsStructAt(int index,
JIStruct value,
int FLAGS)
Add [in] parameter as JIStruct at the specified index in the Parameter list. |
void |
insertInParamAsUnsignedAt(int index,
IJIUnsigned value,
int FLAGS)
Add [in] parameter as IJIUnsigned at the specified index in the Parameter list. |
void |
insertInParamAsUUIDAt(int index,
java.lang.String value,
int FLAGS)
Add [in] parameter as String representation of UUID at the specified index in the Parameter list. |
void |
insertInParamAsVariantAt(int index,
JIVariant value,
int FLAGS)
Add [in] parameter as JIVariant at the specified index in the Parameter list. |
void |
insertOutParamAt(int index,
java.lang.Object classOrInstance,
int FLAGS)
insert an [out] parameter at the specified index in the out parameter list. |
boolean |
isError()
Returns true incase the Call resulted in an exception, use getHRESULT to get the error code. |
void |
read(NetworkDataRepresentation ndr)
|
void |
reInit()
Reinitializes all members of this object. |
void |
removeInParamAt(int index,
int FLAGS)
Removes [in] parameter at the specified index from the Parameter list. |
void |
removeOutParamAt(int index,
int FLAGS)
Removes [out] parameter at the specified index from the out parameters list. |
void |
setInParams(java.lang.Object[] values,
int FLAGS)
Add [in] parameter as Object[] at the end of the Parameter list.The array is iterated and
all members appended to the list. |
void |
setOpnum(int num)
Sets the opnum of the API which will be invoked at the COM server. |
void |
setOutParams(java.lang.Object[] values,
int FLAGS)
Add [out] parameter as Object[] at the end of the Parameter list. |
void |
write(NetworkDataRepresentation ndr)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JICallBuilder(boolean dispatchNotSupported)
dispatchNotSupported
- true
if IDispatch
is
not supported by the IJIComObject
on which this builder would
act. Use IJIComObject.isDispatchSupported()
to find out if
dispatch is supported on the COM Object.public JICallBuilder()
Constructs a builder object. It is assumed that IDispatch
interface is supported by the IJIComObject
on which this builder
would act.
Method Detail |
---|
public void reInit()
IJIComObject.call(org.jinterop.dcom.core.JICallBuilder)
after this step.
public void addInParamAsComObject(IJIComObject comObject, int FLAGS)
[in]
parameter as IJIComObject
at the end of the Parameter list.
comObject
- FLAGS
- from JIFlags (if need be)public void addInParamAsInt(int value, int FLAGS)
[in]
parameter as int
at the end of the Parameter list.
value
- FLAGS
- from JIFlags (if need be)public void addInParamAsUnsigned(IJIUnsigned value, int FLAGS)
[in]
parameter as IJIUnsigned
at the end of the Parameter list.
value
- FLAGS
- from JIFlags (if need be)public void addInParamAsFloat(float value, int FLAGS)
[in]
parameter as float
at the end of the Parameter list.
value
- FLAGS
- from JIFlags (if need be)public void addInParamAsBoolean(boolean value, int FLAGS)
[in]
parameter as boolean
at the end of the Parameter list.
value
- FLAGS
- from JIFlags (if need be)public void addInParamAsShort(short value, int FLAGS)
[in]
parameter as short
at the end of the Parameter list.
value
- FLAGS
- from JIFlags (if need be)public void addInParamAsDouble(double value, int FLAGS)
[in]
parameter as double
at the end of the Parameter list.
value
- FLAGS
- from JIFlags (if need be)public void addInParamAsCharacter(char value, int FLAGS)
[in]
parameter as char
at the end of the Parameter list.
value
- FLAGS
- from JIFlags (if need be)public void addInParamAsString(java.lang.String value, int FLAGS)
[in]
parameter as String
at the end of the Parameter list.
value
- FLAGS
- from JIFlags (These HAVE to be the String Flags).public void addInParamAsVariant(JIVariant value, int FLAGS)
[in]
parameter as JIVariant
at the end of the Parameter list.
value
- FLAGS
- from JIFlags (if need be).public void addInParamAsObject(java.lang.Object value, int FLAGS)
[in]
parameter as Object
at the end of the Parameter list.
value
- FLAGS
- from JIFlags (if need be).public void addInParamAsUUID(java.lang.String value, int FLAGS)
[in]
parameter as String representation of UUID
at the end of the Parameter list.
value
- FLAGS
- from JIFlags (if need be).public void addInParamAsPointer(JIPointer value, int FLAGS)
[in]
parameter as JIPointer
at the end of the Parameter list.
value
- FLAGS
- from JIFlags (if need be).public void addInParamAsStruct(JIStruct value, int FLAGS)
[in]
parameter as JIStruct
at the end of the Parameter list.
value
- FLAGS
- from JIFlags (if need be).public void addInParamAsArray(JIArray value, int FLAGS)
[in]
parameter as JIArray
at the end of the Parameter list.
value
- FLAGS
- from JIFlags (if need be).public void setInParams(java.lang.Object[] values, int FLAGS)
[in]
parameter as Object[]
at the end of the Parameter list.The array is iterated and
all members appended to the list.
values
- FLAGS
- from JIFlags (if need be).public void insertInParamAsComObjectAt(int index, IJIComObject value, int FLAGS)
[in]
parameter as IJIComObject
at the specified index in the Parameter list.
index
- 0 based indexvalue
- FLAGS
- from JIFlags (if need be).public void insertInParamAsIntAt(int index, int value, int FLAGS)
[in]
parameter as int
at the specified index in the Parameter list.
index
- 0 based indexvalue
- FLAGS
- from JIFlags (if need be).public void insertInParamAsUnsignedAt(int index, IJIUnsigned value, int FLAGS)
[in]
parameter as IJIUnsigned
at the specified index in the Parameter list.
index
- 0 based indexvalue
- FLAGS
- from JIFlags (if need be).public void insertInParamAsFloatAt(int index, float value, int FLAGS)
[in]
parameter as float
at the specified index in the Parameter list.
index
- 0 based indexvalue
- FLAGS
- from JIFlags (if need be).public void insertInParamAsBooleanAt(int index, boolean value, int FLAGS)
[in]
parameter as boolean
at the specified index in the Parameter list.
index
- 0 based indexvalue
- FLAGS
- from JIFlags (if need be).public void insertInParamAsShortAt(int index, short value, int FLAGS)
[in]
parameter as short
at the specified index in the Parameter list.
index
- 0 based indexvalue
- FLAGS
- from JIFlags (if need be).public void insertInParamAsDoubleAt(int index, double value, int FLAGS)
[in]
parameter as double
at the specified index in the Parameter list.
index
- 0 based indexvalue
- FLAGS
- from JIFlags (if need be).public void insertInParamAsCharacterAt(int index, char value, int FLAGS)
[in]
parameter as char
at the specified index in the Parameter list.
index
- 0 based indexvalue
- FLAGS
- from JIFlags (if need be).public void insertInParamAsStringAt(int index, java.lang.String value, int FLAGS)
[in]
parameter as String
at the specified index in the Parameter list.
index
- 0 based indexvalue
- FLAGS
- from JIFlags (These HAVE to be the String Flags).public void insertInParamAsVariantAt(int index, JIVariant value, int FLAGS)
[in]
parameter as JIVariant
at the specified index in the Parameter list.
index
- 0 based indexvalue
- FLAGS
- from JIFlags (if need be).public void insertInParamAsObjectAt(int index, java.lang.Object value, int FLAGS)
[in]
parameter as Object
at the specified index in the Parameter list.
index
- 0 based indexvalue
- FLAGS
- from JIFlags (if need be).public void insertInParamAsUUIDAt(int index, java.lang.String value, int FLAGS)
[in]
parameter as String representation of UUID
at the specified index in the Parameter list.
index
- 0 based indexvalue
- FLAGS
- from JIFlags (if need be).public void insertInParamAsPointerAt(int index, JIPointer value, int FLAGS)
[in]
parameter as JIPointer
at the specified index in the Parameter list.
index
- 0 based indexvalue
- FLAGS
- from JIFlags (if need be).public void insertInParamAsStructAt(int index, JIStruct value, int FLAGS)
[in]
parameter as JIStruct
at the specified index in the Parameter list.
index
- 0 based indexvalue
- FLAGS
- from JIFlags (if need be).public void insertInParamAsArrayAt(int index, JIArray value, int FLAGS)
[in]
parameter as JIArray
at the specified index in the Parameter list.
index
- 0 based indexvalue
- FLAGS
- from JIFlags (if need be).public void removeInParamAt(int index, int FLAGS)
[in]
parameter at the specified index from the Parameter list.
index
- 0 based indexFLAGS
- from JIFlags (if need be).public java.lang.Object getInParamAt(int index)
[in]
parameter at the specified index from the Parameter list.
index
- 0 based index
public void addOutParamAsType(java.lang.Class clazz, int FLAGS)
[out]
parameter of the type clazz
at the end of the out parameter list.
clazz
- FLAGS
- public void addOutParamAsObject(java.lang.Object outparam, int FLAGS)
[out]
parameter at the end of the out parameter list. Typically callers are
outparam
- FLAGS
- public void insertOutParamAt(int index, java.lang.Object classOrInstance, int FLAGS)
[out]
parameter at the specified index in the out parameter list.
index
- 0 based indexclassOrInstance
- can be either a Class or an ObjectFLAGS
- public java.lang.Object getOutParamAt(int index)
[out]
param at the index in the out parameters list.
index
- 0 based index
public void removeOutParamAt(int index, int FLAGS)
[out]
parameter at the specified index from the out parameters list.
index
- 0 based indexFLAGS
- from JIFlags (if need be).public void setOutParams(java.lang.Object[] values, int FLAGS)
[out]
parameter as Object[]
at the end of the Parameter list. The array is iterated and
all members appended to the list.
values
- FLAGS
- from JIFlags (if need be).public java.lang.Object[] getResults()
Object[]
. This array has to be iterated over to get the individual values.
public int getResultAsIntAt(int index)
int
at the index from the result list.
index
- 0 based index
public float getResultAsFloatAt(int index)
float
at the index from the result list.
index
- 0 based index
public boolean getResultAsBooleanAt(int index)
boolean
at the index from the result list.
index
- 0 based index
public short getResultAsShortAt(int index)
short
at the index from the result list.
index
- 0 based index
public double getResultAsDoubleAt(int index)
double
at the index from the result list.
index
- 0 based index
public char getResultAsCharacterAt(int index)
char
at the index from the result list.
index
- 0 based index
public JIString getResultAsStringAt(int index)
JIString
at the index from the result list.
index
- 0 based index
public JIVariant getResultAsVariantAt(int index)
JIVariant
at the index from the result list.
index
- 0 based index
public java.lang.String getResultAsUUIDStrAt(int index)
String representation of the UUID
at the index from the result list.
index
- 0 based index
public JIPointer getResultAsPointerAt(int index)
JIPointer
at the index from the result list.
index
- 0 based index
public JIStruct getResultAsStructAt(int index)
JIStruct
at the index from the result list.
index
- 0 based index
public JIArray getResultAsArrayAt(int index)
JIArray
at the index from the result list.
index
- 0 based index
public java.lang.Object[] getResultsInCaseOfException()
public int getHRESULT()
HRESULT
of this operation. This should be zero for successful calls and
non-zero for failures.
public java.lang.Object[] getInParams()
[in]
parameters list.
public java.lang.Object[] getOutParams()
[out]
parameters list.
public java.lang.Integer[] getInparamFlags()
public java.lang.Integer[] getOutparamFlags()
public int getOpnum()
COM
server.
public void setOpnum(int num)
COM
server. This is a 0 based index.
Refer to the IDL of the COM server
for this, all APIs are listed in a sequential order starting from 0. Please ignore the
"Id"
they might be having and count the index of the API being called here from the beginning of the interface starting from
0 as the first index. Also note that if this interface derieves from anything other than IUnknown
or IDispatch
, your start
index will change from 0 to the cumulative(if that interface is also a derieved one) count of the super interface. For e.g if A(3 apis) derieves from B
(10 apis), then first API of A is at Opnum of 3, second at 4 and so on.
Alternatively, you can use the IJIDispatch interface, if the object supports it.
public void write(NetworkDataRepresentation ndr)
public void read(NetworkDataRepresentation ndr)
public boolean isError()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |