1 /* Functions related to the java task instances. */
3 /* Copyright (c) 2007-2012. The SimGrid Team.
4 * All rights reserved. */
6 /* This program is free software; you can redistribute it and/or modify it
7 * under the terms of the license (GNU LGPL) which comes with this package. */
16 * This function returns a global reference to the java task instance
17 * specified by the parameter jtask.
19 * @param jtask The original java task instance.
20 * @param env The environment of the current thread.
22 * @return The global reference to the original java task
25 jobject jtask_new_global_ref(jobject jtask, JNIEnv * env);
28 * This function delete a global reference to a java task instance.
30 * @param The global refernce to delete.
31 * @param env The environment of the current thread.
33 void jtask_delete_global_ref(jobject jtask, JNIEnv * env);
36 * This function associated a native task to a java task instance.
38 * @param jtask The java task instance.
39 * @param task The native task to bind.
40 * @param env The environment of the current thread.
42 * @exception If the class Task is not found the function throws
43 * the ClassNotFoundException. If the field bind of
44 * this class is not found the function throws the exception
45 * NotSuchFieldException.
47 void jtask_bind(jobject jtask, msg_task_t task, JNIEnv * env);
50 * This function returns a native task from a java task instance.
52 * @param jtask The java task object from which get the native task.
53 * @param env The environment of the current thread.
55 * @return The function returns the native task associated to the
58 * @exception If the class Task is not found the function throws
59 * the ClassNotFoundException. If the field bind of
60 * this class is not found the function throws the exception
61 * NotSuchFieldException.
63 msg_task_t jtask_to_native_task(jobject jtask, JNIEnv * env);
66 * This function tests if a java task instance is valid.
67 * A java task object is valid if it is bind to a native
70 * @param jtask The java task to test the validity.
71 * @param env The environment of the current thread.
73 * @return If the java task is valid the function returns true.
74 * Otherwise the function returns false.
76 jboolean jtask_is_valid(jobject jtask, JNIEnv * env);
79 * Class org_simgrid_msg_Task
83 JNIEXPORT void JNICALL
84 Java_org_simgrid_msg_Task_nativeInit(JNIEnv *env, jclass cls);
87 * Class org_simgrid_msg_Task
90 JNIEXPORT void JNICALL
91 Java_org_simgrid_msg_Task_create
92 (JNIEnv * env, jobject jtask, jstring jname, jdouble jcomputeDuration, jdouble jmessageSize);
94 * Class org_simgrid_msg_Task
95 * Method parallelCreate
97 JNIEXPORT void JNICALL
98 Java_org_simgrid_msg_Task_parallelCreate
100 jstring, jobjectArray,
104 * Class org_simgrid_msg_Task
106 * Signature (Lsimgrid/msg/Task;)V
108 JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_destroy
112 * Class org_simgrid_msg_Task
116 JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_cancel
120 * Class org_simgrid_msg_Task
124 JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_execute
128 * Class org_simgrid_msg_Task
130 * Signature ()Ljava/lang/String;
132 JNIEXPORT jstring JNICALL Java_org_simgrid_msg_Task_getName
136 * Class org_simgrid_msg_Task
138 * Signature ()Lsimgrid/msg/Process;
140 JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Task_getSender
143 * Class org_simgrid_msg_Task
145 * Signature ()Lsimgrid/msg/Host;
147 JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Task_getSource
150 * Class org_simgrid_msg_Task
151 * Method getComputeDuration
154 JNIEXPORT jdouble JNICALL Java_org_simgrid_msg_Task_getComputeDuration
158 * Class org_simgrid_msg_Task
159 * Method getRemainingDuration
162 JNIEXPORT jdouble JNICALL
163 Java_org_simgrid_msg_Task_getRemainingDuration(JNIEnv *, jobject);
165 * Class org_simgrid_msg_Task
167 * Signature (Ljava/lang/string;)V
169 JNIEXPORT void JNICALL
170 Java_org_simgrid_msg_Task_setName(JNIEnv *env, jobject jtask, jobject jname);
172 * Class org_simgrid_msg_Task
176 JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_setPriority
177 (JNIEnv *, jobject, jdouble);
179 * Class org_simgrid_msg_Task
180 * Method setComputationAmount
183 JNIEXPORT void JNICALL
184 Java_org_simgrid_msg_Task_setComputeDuration
185 (JNIEnv *env, jobject jtask, jdouble computationAmount);
187 * Class org_simgrid_msg_Task
190 JNIEXPORT void JNICALL
191 Java_org_simgrid_msg_Task_send
192 (JNIEnv *, jobject, jstring, jdouble);
195 * Class org_simgrid_msg_Task
198 JNIEXPORT void JNICALL
199 Java_org_simgrid_msg_Task_sendBounded(JNIEnv *, jobject, jstring,
203 * Class org_simgrid_msg_Task
206 JNIEXPORT jobject JNICALL
207 Java_org_simgrid_msg_Task_receive
208 (JNIEnv *, jclass, jstring, jdouble, jobject);
211 * Class org_simgrid_msg_Task
213 * Signature (Ljava/lang/String;)Lorg/simgrid/msg/Comm;
215 JNIEXPORT jobject JNICALL
216 Java_org_simgrid_msg_Task_irecv(JNIEnv * env, jclass cls, jstring jmailbox);
218 * Class org_simgrid_msg_Task
220 * Signature (Lorg/simgrid/msg/Task;Ljava/lang/String;)Lorg/simgrid/msg/Comm;
222 JNIEXPORT jobject JNICALL
223 Java_org_simgrid_msg_Task_isend(JNIEnv *env, jobject jtask, jstring jmailbox);
225 * Class org_simgrid_msg_Task
228 JNIEXPORT void JNICALL
229 Java_org_simgrid_msg_Task_dsend(JNIEnv * env, jobject jtask,
232 * Class org_simgrid_msg_Task
235 JNIEXPORT jboolean JNICALL
236 Java_org_simgrid_msg_Task_listen(JNIEnv *, jclass, jstring);
238 * Class org_simgrid_msg_Task
239 * Method listenFromHost
241 JNIEXPORT jint JNICALL
242 Java_org_simgrid_msg_Task_listenFromHost(JNIEnv *, jclass, jstring,
245 * Class org_simgrid_msg_Task
248 JNIEXPORT jint JNICALL
249 Java_org_simgrid_msg_Task_listenFrom(JNIEnv *, jclass, jstring);
253 #endif /* !MSG_JTASK_H */