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 new java host instance.
22 * @param env The environment of the current thread
24 * @return A new java host object.
26 * @exception If the class Host is not found the function throws
27 * the ClassNotFoundException. If the constructor of
28 * this class is not found the function throws the exception
29 * NotSuchMethodException.
31 jobject jhost_new_instance(JNIEnv * env);
34 * This function returns a global reference to the java host instance
35 * specified by the parameter jhost.
37 * @param jhost The original java host instance.
38 * @param env The environment of the current thread
40 * @return The global reference to the original java host
43 jobject jhost_ref(JNIEnv * env, jobject jhost);
45 * This function delete a global reference to a java host instance.
47 * @param The global refernce to delete.
48 * @param env The environment of the current thread
50 void jhost_unref(JNIEnv * env, jobject jhost);
53 * This function associated a native host to a java host instance.
55 * @param jhost The java host instance.
56 * @param host The native host to bind.
57 * @param env The environment of the current thread
59 * @exception If the class Host is not found the function throws
60 * the ClassNotFoundException. If the field bind of
61 * this class is not found the function throws the exception
62 * NotSuchFieldException.
64 void jhost_bind(jobject jhost, m_host_t host, JNIEnv * env);
67 * This function returns a native host from a java host instance.
69 * @param jhost The java host object from which get the native host.
70 * @param env The environment of the current thread
72 * @return The function returns the native host associated to the
75 * @exception If the class Host is not found the function throws
76 * the ClassNotFoundException. If the field bind of
77 * this class is not found the function throws the exception
78 * NotSuchFieldException.
80 m_host_t jhost_get_native(JNIEnv * env, jobject jhost);
83 * This function returns the name of a MSG host.
85 * @param jhost A java host object.
86 * @param env The environment of the current thread
88 * @return The name of the host.
90 const char *jhost_get_name(jobject jhost, JNIEnv * env);
94 * This function sets the name of a MSG host.
96 * @param host The host concerned by the operation.
97 * @param jname The new name of the host.
98 * @param env The environment of the current thread
100 void jhost_set_name(jobject jhost, jstring jname, JNIEnv * env);
103 * This function tests if a java host instance is valid.
104 * A java host object is valid if it is bind to a native host.
106 * @param jhost The host to test the validity.
107 * @param env The environment of the current thread
109 * @return If the java host is valid the function returns true.
110 * Otherwise the function returns false.
112 jboolean jhost_is_valid(jobject jhost, JNIEnv * env);
114 #endif /*!MSG_JHOST_H */