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_parallel_task.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 functions in relation with the java
10  * parallel task instance.
11  */
12
13 #ifndef MSG_JPARALLEL_TASK_H
14 #define MSG_JPARALLEL_TASK_H
15
16 #include <jni.h>
17 #include "msg/msg.h"
18
19
20 /**
21  * This function returns a global reference to the java paralllel task instance 
22  * specified by the parameter jparallel_task.
23  *
24  * @param jparallel_task        The original java parallel task instance.
25  * @param env                           The environment of the current thread.
26  *
27  * @return                                      The global reference to the original java parallel task 
28  *                                                      instance.
29  */                     
30 jobject
31 jparallel_task_ref(JNIEnv* env, jobject jparallel_task);
32
33 /**
34  * This function delete a global reference to a java parallel task instance.
35  *
36  * @param jparallel_task        The global refernce to delete.
37  * @param env                           The environment of the current thread.
38  */
39 void
40 jparallel_task_unref(JNIEnv* env,jobject jparallel_task);
41
42 /**
43  * This function associated a native task to a java parallel task instance.
44  *
45  * @param jparallel_task        The java parallel task instance.
46  * @param jparallel_task        The native parallel task to bind.
47  * @param env                           The environment of the current thread.
48  *
49  * @exception                           If the class ParallelTask is not found the function throws 
50  *                                                      the ClassNotFoundException. If the field bind of 
51  *                                                      this class is not found the function throws the exception 
52  *                                                      NotSuchFieldException.  
53  */             
54 void
55 jparallel_task_bind(jobject jparallel_task,m_task_t task,JNIEnv* env);
56
57 /**
58  * This function returns a native task from a java task instance.
59  *
60  * @param jparallel_task        The java parallel task object from which get the native parallel task.
61  * @param env                           The environment of the current thread.
62  *
63  * @return                                      The function returns the native parallel task associated to the
64  *                                                      java parallel task object.
65  *
66  * @exception                           If the class ParallelTask is not found the function throws 
67  *                                                      the ClassNotFoundException. If the field bind of 
68  *                                                      this class is not found the function throws the exception 
69  *                                                      NotSuchFieldException.  
70  */
71 m_task_t
72 jparallel_task_to_native_parallel_task(jobject jparallel_task,JNIEnv* env);
73
74 /**
75  * This function tests if a java task instance is valid.
76  * A java task object is valid if it is bind to a native 
77  * task.
78  *
79  * @param jparallel_task        The java parallel task to test the validity.
80  * @param env                           The environment of the current thread.
81  *
82  * @return                                      If the java parallel task is valid the function returns true.
83  *                                                      Otherwise the function returns false.
84  */
85 jboolean
86 jparallel_task_is_valid(jobject jparallel_task,JNIEnv* env);
87
88
89 #endif /* !MSG_JPARALLEL_TASK_H */