Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'mc++' into mc-merge
[simgrid.git] / src / bindings / java / jmsg_task.h
1 /* Functions related to the java task instances.                            */
2
3 /* Copyright (c) 2007-2014. The SimGrid Team.
4  * All rights reserved.                                                     */
5
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. */
8
9 #ifndef MSG_JTASK_H
10 #define MSG_JTASK_H
11
12 #include <jni.h>
13 #include "msg/msg.h"
14
15 /**
16  * This function returns a global reference to the  java task instance 
17  * specified by the parameter jtask.
18  *
19  * @param jtask                 The original java task instance.
20  * @param env                   The environment of the current thread.
21  *
22  * @return                              The global reference to the original java task 
23  *                                              instance.
24  */
25 /* jobject jtask_new_global_ref(jobject jtask, JNIEnv * env); */
26
27 /**
28  * This function delete a global reference to a java task instance.
29  *
30  * @param                               The global refernce to delete.
31  * @param env                   The environment of the current thread.
32  */
33 /* void jtask_delete_global_ref(jobject jtask, JNIEnv * env); */
34
35 /**
36  * This function associated a native task to a java task instance.
37  *
38  * @param jtask                 The java task instance.
39  * @param task                  The native task to bind.
40  * @param env                   The environment of the current thread.
41  *
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.  
46  */
47 void jtask_bind(jobject jtask, msg_task_t task, JNIEnv * env);
48
49 /**
50  * This function returns a native task from a java task instance.
51  *
52  * @param jtask                 The java task object from which get the native task.
53  * @param env                   The environment of the current thread.
54  *
55  * @return                              The function returns the native task associated to the
56  *                                              java task object.
57  *
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.  
62  */
63 msg_task_t jtask_to_native_task(jobject jtask, JNIEnv * env);
64
65 /**
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 
68  * task.
69  *
70  * @param jtask                 The java task to test the validity.
71  * @param env                   The environment of the current thread.
72  *
73  * @return                              If the java task is valid the function returns true.
74  *                                              Otherwise the function returns false.
75  */
76 jboolean jtask_is_valid(jobject jtask, JNIEnv * env);
77
78 /*
79  * Class                org_simgrid_msg_Task
80  * Method               nativeInit
81  * Signature    ();
82  */
83 JNIEXPORT void JNICALL
84 Java_org_simgrid_msg_Task_nativeInit(JNIEnv *env, jclass cls);
85
86 /*
87  * Class                org_simgrid_msg_Task
88  * Method               create
89  */
90 JNIEXPORT void JNICALL
91 Java_org_simgrid_msg_Task_create
92                 (JNIEnv * env, jobject jtask, jstring jname, jdouble jcomputeDuration, jdouble jmessageSize);
93 /*
94  * Class                org_simgrid_msg_Task
95  * Method               parallelCreate
96  */
97 JNIEXPORT void JNICALL
98 Java_org_simgrid_msg_Task_parallelCreate
99                 (JNIEnv *, jobject,
100      jstring, jobjectArray,
101      jdoubleArray,
102      jdoubleArray);
103 /*
104  * Class                org_simgrid_msg_Task
105  * Method               destroy
106  * Signature    (Lsimgrid/msg/Task;)V
107  */
108 /* JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_destroy */
109 /*     (JNIEnv *, jobject); */
110
111 /*
112  * Class                org_simgrid_msg_Task
113  * Method               cancel
114  * Signature    ()V
115  */
116 JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_cancel
117     (JNIEnv *, jobject);
118
119 /*
120  * Class                org_simgrid_msg_Task
121  * Method               execute
122  * Signature    ()V
123  */
124 JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_execute
125     (JNIEnv *, jobject);
126
127 /*
128  * Class                org_simgrid_msg_Task
129  * Method               setBound
130  * Signature    ()V
131  */
132 JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_setBound
133     (JNIEnv *, jobject, jdouble);
134
135 /*
136  * Class                org_simgrid_msg_Task
137  * Method               getName
138  * Signature    ()Ljava/lang/String;
139  */
140 JNIEXPORT jstring JNICALL Java_org_simgrid_msg_Task_getName
141     (JNIEnv *, jobject);
142
143 /*
144  * Class                org_simgrid_msg_Task
145  * Method               getSender
146  * Signature    ()Lsimgrid/msg/Process;
147  */
148 JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Task_getSender
149     (JNIEnv *, jobject);
150 /*
151  * Class                org_simgrid_msg_Task
152  * Method               getSource
153  * Signature    ()Lsimgrid/msg/Host;
154  */
155 JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Task_getSource
156     (JNIEnv *, jobject);
157 /*
158  * Class                org_simgrid_msg_Task
159  * Method               getComputeDuration
160  * Signature    ()D
161  */
162 JNIEXPORT jdouble JNICALL Java_org_simgrid_msg_Task_getComputeDuration
163     (JNIEnv *, jobject);
164
165 /*
166  * Class                org_simgrid_msg_Task
167  * Method               getRemainingDuration
168  * Signature    ()D
169  */
170 JNIEXPORT jdouble JNICALL
171 Java_org_simgrid_msg_Task_getRemainingDuration(JNIEnv *, jobject);
172 /**
173  * Class                org_simgrid_msg_Task
174  * Method               setName
175  * Signature    (Ljava/lang/string;)V
176  */
177 JNIEXPORT void JNICALL
178 Java_org_simgrid_msg_Task_setName(JNIEnv *env, jobject jtask, jobject jname);
179 /*
180  * Class                org_simgrid_msg_Task
181  * Method               setPriority
182  * Signature    (D)V
183  */
184 JNIEXPORT void JNICALL Java_org_simgrid_msg_Task_setPriority
185     (JNIEnv *, jobject, jdouble);
186 /**
187  * Class                org_simgrid_msg_Task
188  * Method               setComputeDuration
189  * Signature    (D)V
190  */
191 JNIEXPORT void JNICALL
192 Java_org_simgrid_msg_Task_setComputeDuration
193                 (JNIEnv *env, jobject jtask, jdouble computationAmount);
194                 
195                 /**
196  * Class                org_simgrid_msg_Task
197  * Method               setDataSize
198  * Signature    (D)V
199  */
200 JNIEXPORT void JNICALL
201 Java_org_simgrid_msg_Task_setDataSize
202                 (JNIEnv *env, jobject jtask, jdouble dataSize);
203                 
204 /**
205  * Class                org_simgrid_msg_Task
206  * Method               send
207  */
208 JNIEXPORT void JNICALL
209     Java_org_simgrid_msg_Task_send
210     (JNIEnv *, jobject, jstring, jdouble);
211
212 /**
213  * Class                org_simgrid_msg_Task
214  * Method               sendBounded
215  */
216 JNIEXPORT void JNICALL
217     Java_org_simgrid_msg_Task_sendBounded
218     (JNIEnv *, jobject, jstring, jdouble, jdouble);
219
220
221 /**
222  * Class                org_simgrid_msg_Task
223  * Method               receive
224  */
225 JNIEXPORT jobject JNICALL
226     Java_org_simgrid_msg_Task_receive
227     (JNIEnv *, jclass, jstring, jdouble, jobject);
228
229 /**
230  * Class                org_simgrid_msg_Task
231  * Method               irecv
232  * Signature    (Ljava/lang/String;)Lorg/simgrid/msg/Comm;
233  */
234 JNIEXPORT jobject JNICALL
235 Java_org_simgrid_msg_Task_irecv(JNIEnv * env, jclass cls, jstring jmailbox);
236 /**
237  * Class                org_simgrid_msg_Task
238  * Method               receiveBounded
239  */
240 JNIEXPORT jobject JNICALL
241 Java_org_simgrid_msg_Task_receiveBounded(JNIEnv * env, jclass cls,
242                                          jstring jalias, jdouble jtimeout,
243                                          jobject jhost, jdouble rate);
244 /**
245  * Class                org_simgrid_msg_Task
246  * Method               irecvBounded
247  */
248 JNIEXPORT jobject JNICALL
249 Java_org_simgrid_msg_Task_irecvBounded(JNIEnv * env, jclass cls,
250                                        jstring jmailbox, jdouble rate);
251 /**
252  * Class                org_simgrid_msg_Task
253  * Method               isend
254  * Signature    (Lorg/simgrid/msg/Task;Ljava/lang/String;)Lorg/simgrid/msg/Comm;
255  */
256 JNIEXPORT jobject JNICALL
257 Java_org_simgrid_msg_Task_isend(JNIEnv *env, jobject jtask, jstring jmailbox);
258 /**
259  * Class                org_simgrid_msg_Task
260  * Method               isendBounded
261  */
262 JNIEXPORT jobject JNICALL
263 Java_org_simgrid_msg_Task_isendBounded(JNIEnv *env, jobject jtask, jstring jmailbox, jdouble maxrate);
264
265 /**
266  * Class                org_simgrid_msg_Task
267  * Method               dsend
268  */
269 JNIEXPORT void JNICALL
270 Java_org_simgrid_msg_Task_dsend(JNIEnv * env, jobject jtask,
271                                 jstring jalias);
272
273 /**
274  * Class                org_simgrid_msg_Task
275  * Method               dsendBounded
276  */
277 JNIEXPORT void JNICALL
278 Java_org_simgrid_msg_Task_dsendBounded(JNIEnv * env, jobject jtask,
279                                 jstring jalias, jdouble maxrate);
280
281 /**
282  * Class                org_simgrid_msg_Task
283  * Method               listen
284  */
285 JNIEXPORT jboolean JNICALL
286 Java_org_simgrid_msg_Task_listen(JNIEnv *, jclass, jstring);
287 /**
288  * Class                org_simgrid_msg_Task
289  * Method               listenFromHost
290  */
291 JNIEXPORT jint JNICALL
292 Java_org_simgrid_msg_Task_listenFromHost(JNIEnv *, jclass, jstring,
293                                               jobject);
294 /**
295  * Class                org_simgrid_msg_Task
296  * Method               listenFrom
297  */
298 JNIEXPORT jint JNICALL
299 Java_org_simgrid_msg_Task_listenFrom(JNIEnv *, jclass, jstring);
300
301
302
303 #endif                          /* !MSG_JTASK_H */