This function calls a static method.
It is equivalent to the JNI functions CallStatic<type>Method
. However, it also offers the option of transferring or receiving strings directly.
Call
CALL 'JCI_CallStaticMethod' USING
cObj mID arg res
cObj | Class object |
mID | Method ID |
arg | Method arguments |
res | Method result |
Arguments
cObj | Data field of the type |
mID | Data field of the type |
arg | A structure of the form |
res | A structure of the form |
Return value (RETURN-CODE)
JCI-RET-OK
The call was successful.
JCI-RET-ENOVM
No Java VM has been started.
JCI-RET-ENULLOBJ
cObj is JCI-NULL
.
JCI-RET-ENULLID
mId is JCI-NULL
.
JCI-RET-EARGUMENT
cObj is not a class object.
JCI-RET-EARGVERS
The statically generated version number in arg is invalid (possibly overwritten).
JCI-RET-ERESVERS
The statically generated version number in res is invalid (possibly overwritten).
JCI-RET-EARGNUM
The number of arguments transferred (CallArgNum
) is less than 0 or greater than the value used for <max-arguments>
(see section "JCI-METHODARGS - Function arguments").
JCI-RET-EARGTYPE
The value of the ArgType
field is invalid. The ResErrIndex
field contains the number of the faulty argument.
JCI-RET-ERESTYPE
The value of the ResType
field is invalid.
JCI-RET-EARGCONV
An error occurred while an argument was being converted.
The ResErrIndex
field contains the number of the argument, the ResErrCode
field a more precise error code.
JCI-RET-ERESCONV
An error occurred while the result was being converted.
The ResErrCode
field contains a more precise error code.
JCI-RET-EEXCEPT
An exception exists after the method was called. No distinction is made between whether the exception was generated by this or an earlier function call.
The field corresponding to the method result in the res structure is unchanged.
Exceptions
All exceptions which were generated by the called method.
Example
DATA DIVISION. WORKING-STORAGE SECTION. ... 01 MethodArgs. COPY JCI-METHODARGS REPLACING ==<max-arguments>== BY 2. 01 MethodRes. COPY JCI-METHODRES. ... 01 myName. 05 len PIC S9(9) COMP-5 VALUE 30. 05 txt PIC X(30). 01 classObj TYPE JCI-object. 01 methodID TYPE JCI-handle. PROCEDURE DIVISION. ... MOVE 1 TO CallArgNum SET RES-VOID TO TRUE SET ARG-ANUM-STRING(1) IGNORE-TRAILING-SPACES(1) TO TRUE SET ArgValAddr(1) TO ADDRESS OF myName CALL 'JCI_CallStaticMethod' USING classObj methodId MethodArgs MethodRes IF RETURN-CODE NOT = JCI-RET-OK ...