This function returns the method ID (Java handle) for a static method of a class.It is equivalent to the JNI function GetStaticMethodID.
Call
CALL 'JCI_GetStaticMethodID' USING cObj mName mSig mID
cObj | Class object |
mName | Name of the method |
mSig | Signature of the method |
mID | Method ID returned by the function |
Arguments
cObj | Data field of the type |
mName | Structure of the type |
mSig | Structure of the type |
mID | Data field of the type |
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-EARGUMENT
cObj is not a class object.
JCI-RET-ENOTFOUND
The method could not be found.
Exceptions
The exceptions generated by the function correspond to those of the JNI function GetStaticMethodID.
Notes
The method is identified by the name and the signature. The signature can be received by the statement,
javap -s <class-name>
the <class-name> being the name of the class identified by cObj.
Example
DATA DIVISION. WORKING-STORAGE SECTION. COPY JCI-TYPEDEFS. 01 JCIConstants. COPY JCI-CONST. ... 01 methodName. 05 PIC S9(9) COMP-5 VALUE 30. 05 PIC X(30) VALUE 'hello'. 01 methodSig. 05 PIC S9(9) COMP-5 VALUE 80. 05 PIC X(80) VALUE '(Ljava/lang/String;)V'. ... 01 classObj TYPE JCI-object. 01 methodID TYPE JCI-handle. ... PROCEDURE DIVISION. ... CALL 'JCI_GetStaticMethodID' USING classObj methodName methodSig methodID IF RETURN-CODE NOT = JCI-RET-OK ...