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
20 * This function returns a global reference to the java task instance
21 * specified by the parameter jtask.
23 * @param jtask The original java task instance.
24 * @param env The environment of the current thread.
26 * @return The global reference to the original java task
29 jobject jtask_new_global_ref(jobject jtask, JNIEnv * env);
32 * This function delete a global reference to a java task instance.
34 * @param The global refernce to delete.
35 * @param env The environment of the current thread.
37 void jtask_delete_global_ref(jobject jtask, JNIEnv * env);
40 * This function associated a native task to a java task instance.
42 * @param jtask The java task instance.
43 * @param task The native task to bind.
44 * @param env The environment of the current thread.
46 * @exception If the class Task is not found the function throws
47 * the ClassNotFoundException. If the field bind of
48 * this class is not found the function throws the exception
49 * NotSuchFieldException.
51 void jtask_bind(jobject jtask, m_task_t task, JNIEnv * env);
54 * This function returns a native task from a java task instance.
56 * @param jtask The java task object from which get the native task.
57 * @param env The environment of the current thread.
59 * @return The function returns the native task associated to the
62 * @exception If the class Task is not found the function throws
63 * the ClassNotFoundException. If the field bind of
64 * this class is not found the function throws the exception
65 * NotSuchFieldException.
67 m_task_t jtask_to_native_task(jobject jtask, JNIEnv * env);
70 * This function tests if a java task instance is valid.
71 * A java task object is valid if it is bind to a native
74 * @param jtask The java task to test the validity.
75 * @param env The environment of the current thread.
77 * @return If the java task is valid the function returns true.
78 * Otherwise the function returns false.
80 jboolean jtask_is_valid(jobject jtask, JNIEnv * env);
82 #endif /* !MSG_JTASK_H */