Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
New function Process.getCount()
[simgrid.git] / src / jmsg_process.h
index ff30980..566a877 100644 (file)
@@ -1,6 +1,6 @@
 /* Functions related to the java process instances.                         */
 
-/* Copyright (c) 2007, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007-2012. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
 #include <msg/msg.h>
 #include <simgrid/simix.h>
 
-jobject native_to_java_process(m_process_t process);
+//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(msg_process_t process);
 
 /**
  * This function returns a global reference to the  java process instance 
@@ -65,7 +78,7 @@ void jprocess_join(jobject jprocess, JNIEnv * env);
  *                                             this class is not found the function throws the exception 
  *                                             NotSuchFieldException.  
  */
-void jprocess_bind(jobject jprocess, m_process_t process, JNIEnv * env);
+void jprocess_bind(jobject jprocess, msg_process_t process, JNIEnv * env);
 
 /**
  * This function returns a native process from a java process instance.
@@ -81,7 +94,7 @@ void jprocess_bind(jobject jprocess, m_process_t process, JNIEnv * env);
  *                                             this class is not found the function throws the exception 
  *                                             NotSuchFieldException.  
  */
-m_process_t jprocess_to_native_process(jobject jprocess, JNIEnv * env);
+msg_process_t jprocess_to_native_process(jobject jprocess, JNIEnv * env);
 
 /**
  * This function gets the id of the specified java process.
@@ -137,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
@@ -154,37 +168,58 @@ 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);
-
+/*
+ * Class        org_simgrid_msg_Process
+ * Method       waitFor
+ * Signature    (D)V
+ */
+JNIEXPORT jobject JNICALL
+Java_org_simgrid_msg_Process_getProperty(JNIEnv *env, jobject jprocess, jobject jname);
 /*
  * 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_resume
+    (JNIEnv *, jobject);
+/*
+ * Class        org_simgrid_msg_Process
+ * Method       setAutoRestart
+ * Signature    (Lorg/simgrid/msg/Process;Z)V
+ */
+JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_setAutoRestart
+    (JNIEnv *, jobject, jboolean);
+/*
+ * Class        org_simgrid_msg_Process
+ * Method       restart
+ * Signature    (Lorg/simgrid/msg/Process;)V
  */
 JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_restart
     (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);
@@ -206,7 +241,7 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_waitFor
 /*
  * 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 *, jobject);
@@ -214,8 +249,20 @@ JNIEXPORT void JNICALL Java_org_simgrid_msg_Process_kill
 /*
  * 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);
+
+JNIEXPORT jint JNICALL
+Java_org_simgrid_msg_Process_getCount(JNIEnv * env, jclass cls);
+
+
 #endif                          /* !MSG_JPROCESS_H */