4 * Copyright 2006,2007 Martin Quinson, Malek Cherier All right 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.
9 * This contains the declarations of the functions in relation with the java
10 * parallel task instance.
13 #ifndef MSG_JPARALLEL_TASK_H
14 #define MSG_JPARALLEL_TASK_H
21 * This function returns a global reference to the java paralllel task instance
22 * specified by the parameter jparallel_task.
24 * @param jparallel_task The original java parallel task instance.
25 * @param env The environment of the current thread.
27 * @return The global reference to the original java parallel task
31 jparallel_task_ref(JNIEnv* env, jobject jparallel_task);
34 * This function delete a global reference to a java parallel task instance.
36 * @param jparallel_task The global refernce to delete.
37 * @param env The environment of the current thread.
40 jparallel_task_unref(JNIEnv* env,jobject jparallel_task);
43 * This function associated a native task to a java parallel task instance.
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.
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.
55 jparallel_task_bind(jobject jparallel_task,m_task_t task,JNIEnv* env);
58 * This function returns a native task from a java task instance.
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.
63 * @return The function returns the native parallel task associated to the
64 * java parallel task object.
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.
72 jparallel_task_to_native_parallel_task(jobject jparallel_task,JNIEnv* env);
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
79 * @param jparallel_task The java parallel task to test the validity.
80 * @param env The environment of the current thread.
82 * @return If the java parallel task is valid the function returns true.
83 * Otherwise the function returns false.
86 jparallel_task_is_valid(jobject jparallel_task,JNIEnv* env);
89 #endif /* !MSG_JPARALLEL_TASK_H */