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.
32 jhost_new_instance(JNIEnv* env);
35 * This function returns a global reference to the java host instance
36 * specified by the parameter jhost.
38 * @param jhost The original java host instance.
39 * @param env The environment of the current thread
41 * @return The global reference to the original java host
44 jobject jhost_ref(JNIEnv* env,jobject jhost);
46 * This function delete a global reference to a java host instance.
48 * @param The global refernce to delete.
49 * @param env The environment of the current thread
51 void jhost_unref(JNIEnv* env, jobject jhost);
54 * This function associated a native host to a java host instance.
56 * @param jhost The java host instance.
57 * @param host The native host to bind.
58 * @param env The environment of the current thread
60 * @exception If the class Host is not found the function throws
61 * the ClassNotFoundException. If the field bind of
62 * this class is not found the function throws the exception
63 * NotSuchFieldException.
66 jhost_bind(jobject jhost,m_host_t host,JNIEnv* env);
69 * This function returns a native host from a java host instance.
71 * @param jhost The java host object from which get the native host.
72 * @param env The environment of the current thread
74 * @return The function returns the native host associated to the
77 * @exception If the class Host is not found the function throws
78 * the ClassNotFoundException. If the field bind of
79 * this class is not found the function throws the exception
80 * NotSuchFieldException.
83 jhost_get_native(JNIEnv* env,jobject jhost);
86 * This function returns the name of a MSG host.
88 * @param jhost A java host object.
89 * @param env The environment of the current thread
91 * @return The name of the host.
94 jhost_get_name(jobject jhost,JNIEnv* env);
98 * This function sets the name of a MSG host.
100 * @param host The host concerned by the operation.
101 * @param jname The new name of the host.
102 * @param env The environment of the current thread
105 jhost_set_name(jobject jhost,jstring jname,JNIEnv* env);
108 * This function tests if a java host instance is valid.
109 * A java host object is valid if it is bind to a native host.
111 * @param jhost The host to test the validity.
112 * @param env The environment of the current thread
114 * @return If the java host is valid the function returns true.
115 * Otherwise the function returns false.
118 jhost_is_valid(jobject jhost,JNIEnv* env);
120 #endif /*!MSG_JHOST_H */