The days of JNI is counted, Project Panama is on the rise to tear down the walls between Java and C/C++ forever. FFI (Foreign Function Interface) technology finally arrives into the Java world.
18. www.hazelcast.com@noctarius2k
Starting with the C part :-)
extern C {
JNIEXPORT int JNICALL
Java_ProcessIdentifier_getProcessId(JNIEnv *, jobject);
}
export it as a JNI method
Java Classname
19. www.hazelcast.com@noctarius2k
Starting with the C part :-)
extern C {
JNIEXPORT int JNICALL
Java_ProcessIdentifier_getProcessId(JNIEnv *, jobject);
}
export it as a JNI method
Java Classname Java Methodname
20. www.hazelcast.com@noctarius2k
extern C {
JNIEXPORT int JNICALL
Java_ProcessIdentifier_getProcessId(JNIEnv *, jobject);
}
Starting with the C part :-)
JNIEXPORT int JNICALL
Java_ProcessIdentifier_getProcessId(JNIEnv *env, jobject thisObject) {
return getpid();
}
21. www.hazelcast.com@noctarius2k
extern C {
JNIEXPORT int JNICALL
Java_ProcessIdentifier_getProcessId(JNIEnv *, jobject);
}
Starting with the C part :-)
JNIEXPORT int JNICALL
Java_ProcessIdentifier_getProcessId(JNIEnv *env, jobject thisObject) {
return getpid();
}
kernel call