Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
This commit concerned the reimplementation of the xbt context switch mechanism.
[simgrid.git] / src / java / jmsg.h
1 /*
2  * $Id$
3  *
4  * Copyright 2006,2007 Martin Quinson, Malek Cherier All right 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  * This contains the declarations of the wrapper functions used to interface
10  * the java object with the native functions of the MSG API.
11  */
12
13 #ifndef MSG4JAVA_H
14 #define MSG4JAVA_H
15
16 #include <jni.h>
17
18 JavaVM *
19 get_java_VM(void);
20
21 JNIEnv *
22 get_current_thread_env(void);
23
24 /*
25  * Class                simgrid_msg_Msg
26  * Method               processCreate
27  * Signature    (Lsimgrid/msg/Process;Lsimgrid/msg/Host;)V
28  */
29 JNIEXPORT void JNICALL 
30 Java_simgrid_msg_Msg_processCreate(JNIEnv* env,jclass cls,jobject jprocess,jobject jhost);
31
32
33
34 /*
35  * Class                simgrid_msg_Msg
36  * Method               processSuspend
37  * Signature    (Lsimgrid/msg/Process;)V
38  */
39 JNIEXPORT void JNICALL 
40 Java_simgrid_msg_Msg_processSuspend(JNIEnv* env, jclass cls, jobject jprocess);
41
42 /*
43  * Class                simgrid_msg_Msg
44  * Method               processResume
45  * Signature    (Lsimgrid/msg/Process;)V
46  */
47 JNIEXPORT void JNICALL Java_simgrid_msg_Msg_processResume
48   (JNIEnv *, jclass, jobject);
49
50 /*
51  * Class                simgrid_msg_Msg
52  * Method               processIsSuspended
53  * Signature    (Lsimgrid/msg/Process;)Z
54  */
55 JNIEXPORT jboolean JNICALL Java_simgrid_msg_Msg_processIsSuspended
56   (JNIEnv *, jclass, jobject);
57
58 /*
59  * Class                simgrid_msg_Msg
60  * Method               processKill
61  * Signature    (Lsimgrid/msg/Process;)V
62  */
63 JNIEXPORT void JNICALL Java_simgrid_msg_Msg_processKill
64   (JNIEnv *, jclass, jobject);
65
66 /*
67  * Class                simgrid_msg_Msg
68  * Method               processGetHost
69  * Signature    (Lsimgrid/msg/Process;)Lsimgrid/msg/Host;
70  */
71 JNIEXPORT jobject JNICALL Java_simgrid_msg_Msg_processGetHost
72   (JNIEnv *, jclass, jobject);
73
74 /*
75  * Class                simgrid_msg_Msg
76  * Method               processFromPID
77  * Signature    (I)Lsimgrid/msg/Process;
78  */
79 JNIEXPORT jobject JNICALL Java_simgrid_msg_Msg_processFromPID
80   (JNIEnv *, jclass, jint);
81
82 /*
83  * Class                simgrid_msg_Msg
84  * Method               processGetPID
85  * Signature    (Lsimgrid/msg/Process;)I
86  */
87 JNIEXPORT jint JNICALL Java_simgrid_msg_Msg_processGetPID
88   (JNIEnv *, jclass, jobject);
89
90 /*
91  * Class                simgrid_msg_Msg
92  * Method               processGetPPID
93  * Signature    (Lsimgrid/msg/Process;)I
94  */
95 JNIEXPORT jint JNICALL Java_simgrid_msg_Msg_processGetPPID
96   (JNIEnv *, jclass, jobject);
97
98 /*
99  * Class                simgrid_msg_Msg
100  * Method               processSelf
101  * Signature    ()Lsimgrid/msg/Process;
102  */
103 JNIEXPORT jobject JNICALL Java_simgrid_msg_Msg_processSelf
104   (JNIEnv *, jclass);
105
106 /*
107  * Class                simgrid_msg_Msg
108  * Method               processSelfPID
109  * Signature    ()I
110  */
111 JNIEXPORT jint JNICALL Java_simgrid_msg_Msg_processSelfPID
112   (JNIEnv *, jclass);
113
114 /*
115  * Class                simgrid_msg_Msg
116  * Method               processSelfPPID
117  * Signature    ()I
118  */
119 JNIEXPORT jint JNICALL Java_simgrid_msg_Msg_processSelfPPID
120   (JNIEnv *, jclass);
121
122 /*
123  * Class                simgrid_msg_Msg
124  * Method               processChangeHost
125  * Signature    (Lsimgrid/msg/Process;Lsimgrid/msg/Host;)V
126  */
127 JNIEXPORT void JNICALL Java_simgrid_msg_Msg_processChangeHost
128   (JNIEnv *, jclass, jobject, jobject);
129
130 /*
131  * Class                simgrid_msg_Msg
132  * Method               processWaitFor
133  * Signature    (D)V
134  */
135 JNIEXPORT void JNICALL Java_simgrid_msg_Msg_processWaitFor
136   (JNIEnv *, jclass, jdouble);
137
138 /*
139  * Class                simgrid_msg_Msg
140  * Method               hostGetByName
141  * Signature    (Ljava/lang/String;)Lsimgrid/msg/Host;
142  */
143 JNIEXPORT jobject JNICALL Java_simgrid_msg_Msg_hostGetByName
144   (JNIEnv *, jclass, jstring);
145
146 /*
147  * Class                simgrid_msg_Msg
148  * Method               hostGetName
149  * Signature    (Lsimgrid/msg/Host;)Ljava/lang/String;
150  */
151 JNIEXPORT jstring JNICALL Java_simgrid_msg_Msg_hostGetName
152   (JNIEnv *, jclass, jobject);
153
154 /*
155  * Class                simgrid_msg_Msg
156  * Method               hostGetNumber
157  * Signature    ()I
158  */
159 JNIEXPORT jint JNICALL Java_simgrid_msg_Msg_hostGetNumber
160   (JNIEnv *, jclass);
161
162 /*
163  * Class                simgrid_msg_Msg
164  * Method               hostSelf
165  * Signature    ()Lsimgrid/msg/Host;
166  */
167 JNIEXPORT jobject JNICALL Java_simgrid_msg_Msg_hostSelf
168   (JNIEnv *, jclass);
169
170 /*
171  * Class                simgrid_msg_Msg
172  * Method               hostGetSpeed
173  * Signature    (Lsimgrid/msg/Host;)D
174  */
175 JNIEXPORT jdouble JNICALL Java_simgrid_msg_Msg_hostGetSpeed
176   (JNIEnv *, jclass, jobject);
177
178 JNIEXPORT jint JNICALL 
179 Java_simgrid_msg_Msg_hostGetLoad(JNIEnv* env, jclass cls, jobject jhost);
180
181 /*
182  * Class                simgrid_msg_Msg
183  * Method               hostIsAvail
184  * Signature    (Lsimgrid/msg/Host;)Z
185  */
186 JNIEXPORT jboolean JNICALL Java_simgrid_msg_Msg_hostIsAvail
187   (JNIEnv *, jclass, jobject);
188
189 /*
190  * Class                simgrid_msg_Msg
191  * Method               taskCreate
192  * Signature    (Lsimgrid/msg/Task;Ljava/lang/String;DD)V
193  */
194 JNIEXPORT void JNICALL Java_simgrid_msg_Msg_taskCreate
195   (JNIEnv *, jclass, jobject, jstring, jdouble, jdouble);
196
197 JNIEXPORT void JNICALL 
198 Java_simgrid_msg_Msg_parallel_taskCreate(JNIEnv*, jclass, jobject, jstring, jobjectArray,jdoubleArray, jdoubleArray);
199
200 /*
201  * Class                simgrid_msg_Msg
202  * Method               taskGetSender
203  * Signature    (Lsimgrid/msg/Task;)Lsimgrid/msg/Process;
204  */
205 JNIEXPORT jobject JNICALL Java_simgrid_msg_Msg_taskGetSender
206   (JNIEnv *, jclass, jobject);
207
208 JNIEXPORT jobject JNICALL 
209 Java_simgrid_msg_Msg_parallelTaskGetSender(JNIEnv* env , jclass cls , jobject jparallel_task);
210
211 /*
212  * Class                simgrid_msg_Msg
213  * Method               taskGetSource
214  * Signature    (Lsimgrid/msg/Task;)Lsimgrid/msg/Host;
215  */
216 JNIEXPORT jobject JNICALL Java_simgrid_msg_Msg_taskGetSource
217   (JNIEnv *, jclass, jobject);
218
219 JNIEXPORT jobject JNICALL 
220 Java_simgrid_msg_Msg_parallelTaskGetSource(JNIEnv* env , jclass cls, jobject jparallel_task);
221
222 /*
223  * Class                simgrid_msg_Msg
224  * Method               taskGetName
225  * Signature    (Lsimgrid/msg/Task;)Ljava/lang/String;
226  */
227 JNIEXPORT jstring JNICALL Java_simgrid_msg_Msg_taskGetName
228   (JNIEnv *, jclass, jobject);
229
230 JNIEXPORT jstring JNICALL 
231 Java_simgrid_msg_Msg_parallelTaskGetName(JNIEnv* env, jclass cls, jobject jparallel_task);
232
233 /*
234  * Class                simgrid_msg_Msg
235  * Method               taskCancel
236  * Signature    (Lsimgrid/msg/Task;)V
237  */
238 JNIEXPORT void JNICALL Java_simgrid_msg_Msg_taskCancel
239   (JNIEnv *, jclass, jobject);
240
241 JNIEXPORT void JNICALL 
242 Java_simgrid_msg_Msg_parallelTaskCancel(JNIEnv* env, jclass cls, jobject jparallel_task);
243
244 /*
245  * Class                simgrid_msg_Msg
246  * Method               taskGetComputeDuration
247  * Signature    (Lsimgrid/msg/Task;)D
248  */
249 JNIEXPORT jdouble JNICALL Java_simgrid_msg_Msg_taskGetComputeDuration
250   (JNIEnv *, jclass, jobject);
251
252 JNIEXPORT jdouble JNICALL 
253 Java_simgrid_msg_Msg_parallelTaskGetComputeDuration(JNIEnv* env, jclass cls, jobject jparallel_task);
254
255 /*
256  * Class                simgrid_msg_Msg
257  * Method               taskGetRemainingDuration
258  * Signature    (Lsimgrid/msg/Task;)D
259  */
260 JNIEXPORT jdouble JNICALL Java_simgrid_msg_Msg_taskGetRemainingDuration
261   (JNIEnv *, jclass, jobject);
262
263 JNIEXPORT jdouble JNICALL 
264 Java_simgrid_msg_Msg_paralleTaskGetRemainingDuration(JNIEnv* env, jclass cls, jobject jparallel_task);
265
266 /*
267  * Class                simgrid_msg_Msg
268  * Method               taskSetPriority
269  * Signature    (Lsimgrid/msg/Task;D)V
270  */
271 JNIEXPORT void JNICALL Java_simgrid_msg_Msg_taskSetPriority
272   (JNIEnv *, jclass, jobject, jdouble);
273
274 JNIEXPORT void JNICALL 
275 Java_simgrid_msg_Msg_parallelTaskSetPriority(JNIEnv* env, jclass cls, jobject jparallel_task, jdouble priority);
276
277 /*
278  * Class                simgrid_msg_Msg
279  * Method               taskDestroy
280  * Signature    (Lsimgrid/msg/Task;)V
281  */
282 JNIEXPORT void JNICALL Java_simgrid_msg_Msg_taskDestroy
283   (JNIEnv *, jclass, jobject);
284
285 JNIEXPORT void JNICALL 
286 Java_simgrid_msg_Msg_parallelTaskDestroy(JNIEnv* env, jclass cls, jobject jparallel_task);
287
288 /*
289  * Class                simgrid_msg_Msg
290  * Method               taskExecute
291  * Signature    (Lsimgrid/msg/Task;)V
292  */
293 JNIEXPORT void JNICALL Java_simgrid_msg_Msg_taskExecute
294   (JNIEnv *, jclass, jobject);
295
296 JNIEXPORT void JNICALL 
297 Java_simgrid_msg_Msg_parallelTaskExecute(JNIEnv* env, jclass cls, jobject jparallel_task);
298
299 /*
300  * Class                simgrid_msg_Msg
301  * Method               channelGet
302  * Signature    (Lsimgrid/msg/Channel;)Lsimgrid/msg/Task;
303  */
304 JNIEXPORT jobject JNICALL Java_simgrid_msg_Msg_channelGet
305   (JNIEnv *, jclass, jobject);
306
307 /*
308  * Class                simgrid_msg_Msg
309  * Method               channelGetWithTimeout
310  * Signature    (Lsimgrid/msg/Channel;D)Lsimgrid/msg/Task;
311  */
312 JNIEXPORT jobject JNICALL Java_simgrid_msg_Msg_channelGetWithTimeout
313   (JNIEnv *, jclass, jobject, jdouble);
314
315 /*
316  * Class                simgrid_msg_Msg
317  * Method               channelGetFromHost
318  * Signature    (Lsimgrid/msg/Channel;Lsimgrid/msg/Host;)Lsimgrid/msg/Task;
319  */
320 JNIEXPORT jobject JNICALL Java_simgrid_msg_Msg_channelGetFromHost
321   (JNIEnv *, jclass, jobject, jobject);
322
323 /*
324  * Class                simgrid_msg_Msg
325  * Method               channelHasPendingCommunication
326  * Signature    (Lsimgrid/msg/Channel;)Z
327  */
328 JNIEXPORT jboolean JNICALL Java_simgrid_msg_Msg_channelHasPendingCommunication
329   (JNIEnv *, jclass, jobject);
330
331 /*
332  * Class                simgrid_msg_Msg
333  * Method               channelGetCommunicatingProcess
334  * Signature    (Lsimgrid/msg/Channel;)I
335  */
336 JNIEXPORT jint JNICALL Java_simgrid_msg_Msg_channelGetCommunicatingProcess
337   (JNIEnv *, jclass, jobject);
338
339 /*
340  * Class                simgrid_msg_Msg
341  * Method               channelGetHostWaitingTasks
342  * Signature    (Lsimgrid/msg/Channel;Lsimgrid/msg/Host;)I
343  */
344 JNIEXPORT jint JNICALL Java_simgrid_msg_Msg_channelGetHostWaitingTasks
345   (JNIEnv *, jclass, jobject, jobject);
346
347 /*
348  * Class                simgrid_msg_Msg
349  * Method               channelPut
350  * Signature    (Lsimgrid/msg/Channel;Lsimgrid/msg/Task;Lsimgrid/msg/Host;)V
351  */
352 JNIEXPORT void JNICALL Java_simgrid_msg_Msg_channelPut
353   (JNIEnv *, jclass, jobject, jobject, jobject);
354
355 /*
356  * Class                simgrid_msg_Msg
357  * Method               channelPutWithTimeout
358  * Signature    (Lsimgrid/msg/Channel;Lsimgrid/msg/Task;Lsimgrid/msg/Host;D)V
359  */
360 JNIEXPORT void JNICALL Java_simgrid_msg_Msg_channelPutWithTimeout
361   (JNIEnv *, jclass, jobject, jobject, jobject, jdouble);
362
363 /*
364  * Class                simgrid_msg_Msg
365  * Method               channelPutBounded
366  * Signature    (Lsimgrid/msg/Channel;Lsimgrid/msg/Task;Lsimgrid/msg/Host;D)V
367  */
368 JNIEXPORT void JNICALL Java_simgrid_msg_Msg_channelPutBounded
369   (JNIEnv *, jclass, jobject, jobject, jobject, jdouble);
370
371 /*
372  * Class                simgrid_msg_Msg
373  * Method               channelWait
374  * Signature    (Lsimgrid/msg/Channel;D)I
375  */
376 JNIEXPORT jint JNICALL Java_simgrid_msg_Msg_channelWait
377   (JNIEnv *, jclass, jobject, jdouble);
378
379 /*
380  * Class                simgrid_msg_Msg
381  * Method               channelSetNumber
382  * Signature    (I)V
383  */
384 JNIEXPORT void JNICALL Java_simgrid_msg_Msg_channelSetNumber
385   (JNIEnv *, jclass, jint);
386
387 /*
388  * Class                simgrid_msg_Msg
389  * Method               channelGetNumber
390  * Signature    ()I
391  */
392 JNIEXPORT jint JNICALL Java_simgrid_msg_Msg_channelGetNumber
393   (JNIEnv *, jclass);
394
395 /*
396  * Class                simgrid_msg_Msg
397  * Method               getErrCode
398  * Signature    ()I
399  */
400 JNIEXPORT jint JNICALL Java_simgrid_msg_Msg_getErrCode
401   (JNIEnv *, jclass);
402
403 /*
404  * Class                simgrid_msg_Msg
405  * Method               getClock
406  * Signature    ()D
407  */
408 JNIEXPORT jdouble JNICALL Java_simgrid_msg_Msg_getClock
409   (JNIEnv *, jclass);
410
411
412 JNIEXPORT void JNICALL Java_simgrid_msg_Msg_init
413   (JNIEnv *, jclass, jobjectArray);
414
415
416 JNIEXPORT void JNICALL
417 JNICALL Java_simgrid_msg_Msg_run(JNIEnv* env, jclass cls);
418
419 JNIEXPORT void JNICALL 
420 Java_simgrid_msg_Msg_init(JNIEnv* env, jclass cls, jobjectArray jargs);
421
422 /*
423  * Class                simgrid_msg_Msg
424  * Method               processKillAll
425  * Signature    (I)I
426  */
427 JNIEXPORT jint JNICALL Java_simgrid_msg_Msg_processKillAll
428   (JNIEnv *, jclass, jint);
429
430 /*
431  * Class                simgrid_msg_Msg
432  * Method               processExit
433  * Signature    (Lsimgrid/msg/Process;)V
434  */
435 JNIEXPORT void JNICALL Java_simgrid_msg_Msg_processExit
436   (JNIEnv *, jclass, jobject);
437
438
439 JNIEXPORT void JNICALL 
440 Java_simgrid_msg_Msg_pajeOutput(JNIEnv* env, jclass cls, jstring jpajeFile);
441
442 /*
443  * Class                simgrid_msg_Msg
444  * Method               waitSignal
445  * Signature    (Lsimgrid/msg/Process;)V
446  */
447 JNIEXPORT void JNICALL Java_simgrid_msg_Msg_waitSignal
448   (JNIEnv *, jclass, jobject);
449
450 JNIEXPORT void JNICALL 
451 Java_simgrid_msg_Msg_info(JNIEnv * , jclass , jstring );
452
453 JNIEXPORT jobjectArray JNICALL
454 Java_simgrid_msg_Msg_allHosts(JNIEnv * , jclass );
455
456 JNIEXPORT void JNICALL 
457 Java_simgrid_msg_Msg_createEnvironment(JNIEnv* env, jclass cls,jstring jplatformFile);
458
459 JNIEXPORT void JNICALL 
460 Java_simgrid_msg_Msg_platformLoad(JNIEnv* env, jclass cls, jobject jplatform);
461
462
463 JNIEXPORT void JNICALL 
464 Java_simgrid_msg_Msg_selectContextFactory(JNIEnv *, jclass, jstring);
465
466 #endif /* !MSG4JAVA_H */