Logo AND Algorithmique Numérique Distribuée

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