|
>>Naturally I disagree with James' comments about Java! I meant to say that I disagree with James' comments about RPG also: I guess I need hardly say that ILE/RPG is a terrific and elegant language, superb for programmer productivity and well-suited to heavy duty database transaction processing native on the iSeries. The integration features with Java are extremely well done - the only issue with Java integration that I can see is the necessity to serialize for thread-blocking at the level of the module (as mentioned earlier). When it comes to calling Java from RPG, however, I need to be reassured that it is possible for an ILE RPG procedure to call into a specific instance of a JVM running in OS/400 - for example a WebSphere Application Server Instance. The RPG Programmers manual has the following rather obscure code for finding an existing running JVM: * * See if there's a JVM started C Eval rc = JNI_GetCreatedJavaVMs( C jvm : bufLen: nVMs) * * If JVM is started, just attach to it to get the env pointer. C If rc = 0 C and nVMs > 0 C Eval attachArgs = *ALLX'00' C Eval JavaVM_P = jvm(1) C Eval rc = AttachCurrentThread (jvm(1) : C env : %addr(attachArgs)) * * If JVM is not started, start it with the default class path. C Else C Eval initArgs = *ALLX'00' C Eval rc = JNI_GetDefaultJavaVMInitArgs( C %addr(initArgs)) C If rc = 0 C Eval rc = JNI_CreateJavaVM(jvm(1) : env: C %addr(initArgs) ) C EndIf C EndIf The question is: how can the program know which is the correct JVM to attach to? For example, there may be a requirement always to attach to a given WAS JVM instance. I suppose an alternative would be to customize the WAS instance, on start up, to call out to RPG in order to insure that the WAS instance is known to RPG. Maybe I'm way off-base here - if so, can someone let me know! Chris Jewell
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.