X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/44da6699977c942b1a34734e118cb9842aaeb94b..d318c9e02308e2c7c66e3fcc06105d96332ebb44:/src/jmsg_process.h diff --git a/src/jmsg_process.h b/src/jmsg_process.h index 6d1caba867..7d5beadcd3 100644 --- a/src/jmsg_process.h +++ b/src/jmsg_process.h @@ -13,6 +13,19 @@ #include #include +//Cached java fields +jfieldID jprocess_field_Process_bind; +jfieldID jprocess_field_Process_host; +jfieldID jprocess_field_Process_killTime; +jfieldID jprocess_field_Process_id; +jfieldID jprocess_field_Process_name; +jfieldID jprocess_field_Process_pid; +jfieldID jprocess_field_Process_ppid; + +JNIEXPORT void JNICALL +Java_org_simgrid_msg_Process_exit(JNIEnv *env, jobject); + + jobject native_to_java_process(m_process_t process); /** @@ -53,33 +66,6 @@ void jprocess_delete_global_ref(jobject jprocess, JNIEnv * env); * */ void jprocess_join(jobject jprocess, JNIEnv * env); - -/** - * This function starts the specified java process. - * - * @param jprocess The java process to start. - * @param env The env of the current thread - * - * @exception If the class Process is not found the function throws - * the ClassNotFoundException. If the methos start() of - * this class is not found the function throws the exception - * NotSuchMethodException. - */ -void jprocess_start(jobject jprocess, JNIEnv * env); - -/** - * This function forces the java process to stop. - * - * @param jprocess The java process to stop. - * @param env The env of the current thread - * - * @exception If the class Process is not found the function throws - * the ClassNotFoundException. If the methos stop() of - * this class is not found the function throws the exception - * NotSuchMethodException. - */ -void jprocess_exit(jobject jprocess, JNIEnv * env); - /** * This function associated a native process to a java process instance. * @@ -164,11 +150,12 @@ Java_org_simgrid_msg_Process_nativeInit(JNIEnv *env, jclass cls); /* * Class org_simgrid_msg_Process * Method create - * Signature (Lsimgrid/msg/Host;)V + * Signature (Lorg/simgrid/msg/Host;)V */ JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_create(JNIEnv * env, - jobject jprocess, jobject jhost); + jobject jprocess_arg, + jobject jhostname); /* * Class org_simgrid_msg_Process @@ -181,7 +168,7 @@ JNIEXPORT jint JNICALL Java_org_simgrid_msg_Process_killAll /* * Class org_simgrid_msg_Process * Method fromPID - * Signature (I)Lsimgrid/msg/Process; + * Signature (I)Lorg/simgrid/msg/Process; */ JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Process_fromPID (JNIEnv *, jclass, jint); @@ -189,29 +176,29 @@ JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Process_fromPID /* * Class org_simgrid_msg_Process * Method currentProcess - * Signature ()Lsimgrid/msg/Process; + * Signature ()Lorg/simgrid/msg/Process; */ JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Process_currentProcess (JNIEnv *, jclass); /* * Class org_simgrid_msg_Process - * Method pause - * Signature (Lsimgrid/msg/Process;)V + * Method suspend + * Signature (Lorg/simgrid/msg/Process;)V */ JNIEXPORT void JNICALL -Java_org_simgrid_msg_Process_pause(JNIEnv * env, +Java_org_simgrid_msg_Process_suspend(JNIEnv * env, jobject jprocess); /* * Class org_simgrid_msg_Process - * Method restart - * Signature (Lsimgrid/msg/Process;)V + * Method resume + * Signature (Lorg/simgrid/msg/Process;)V */ -JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_restart +JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_resume (JNIEnv *, jobject); /* * Class org_simgrid_msg_Process * Method isSuspended - * Signature (Lsimgrid/msg/Process;)Z + * Signature (Lorg/simgrid/msg/Process;)Z */ JNIEXPORT jboolean JNICALL Java_org_simgrid_msg_Process_isSuspended (JNIEnv *, jobject); @@ -230,26 +217,27 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_sleep */ JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_waitFor (JNIEnv *, jobject, jdouble); -/** - * Class org_simgrid_msg_Process - * Method exit - * Signature ()V - */ -JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_exit - (JNIEnv *, jobject); /* * Class org_simgrid_msg_Process * Method kill - * Signature (Lsimgrid/msg/Process;)V + * Signature (Lorg/simgrid/msg/Process;)V */ JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_kill - (JNIEnv *, jclass, jobject); + (JNIEnv *, jobject); /* * Class org_simgrid_msg_Process * Method migrate - * Signature (Lsimgrid/msg/Host;)V + * Signature (Lorg/simgrid/msg/Host;)V */ JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_migrate (JNIEnv *, jobject, jobject); +/* + * Class org_simgrid_msg_Process + * Method setKillTime + * Signature (D)V + */ +JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_setKillTime + (JNIEnv *, jobject, jdouble); + #endif /* !MSG_JPROCESS_H */