PATH![]() |
When you create an instantiation of the Java runtime environment using the JMOpenSession function, you must pass a data structure that supplies callback information for that instantiation. The session callbacks data structure is defined by the JMSessionCallbacks data type.
struct JMSessionCallbacks {
UInt32 fVersion; /* set to kJMVersion */
JMConsoleProcPtr fStandardOutput; /* standard output */
JMConsoleProcPtr fStandardError; /* standard error */
JMConsoleReadProcPtr fStandardIn; /* standard input */
JMExitProcPtr fExitProc; /* handle System.exit */
JMAuthenticateURLProcPtrfAuthenticateProc; /* for authentication */
JMLowMemoryProcPtr fLowMemProc; /* low memory warning */
};
typedef void (*JMConsoleProcPtr) (
JMSessionRef session, const char* message,
UInt32 messageLen);
MyStandardOutput
.
typedef void (*JMConsoleProcPtr) (
JMSessionRef session, const char* message,
UInt32 messageLen);
MyStandardError
.
typedef SInt32 (*JMConsoleReadProcPtr) (
JMSessionRef session, char* buffer,
SInt32 maxBufferLength);
MyStandardIn
.
typedef Boolean (*JMExitProcPtr) (
JMSessionRef session, int value);
MyExit
.
typedef Boolean (*JMAuthenticateURLProcPtr) (
JMSessionRef session, const char* url,
const char* realm, char userName[255],
char password[255]);
MyAuthenticate
.
typedef Boolean (*JMLowMemoryProcPtr) (
JMSessionRef session);
MyLowMem
.