Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Do not require doxygen in maintainer mode
[simgrid.git] / src / java / jmsg_host.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  * host instance.
11  */
12  
13 #ifndef MSG_JHOST_H
14 #define MSG_JHOST_H
15
16 #include <jni.h>
17 #include "msg/msg.h"
18
19 /**
20  * This function returns a new java host instance.
21  *
22  * @param env                   The environment of the current thread
23  *
24  * @return                              A new java host object.
25  *
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.
30  */
31 jobject
32 jhost_new_instance(JNIEnv* env);
33
34 /**
35  * This function returns a global reference to the  java host instance 
36  * specified by the parameter jhost.
37  *
38  * @param jhost                 The original java host instance.
39  * @param env                   The environment of the current thread
40  *
41  * @return                              The global reference to the original java host 
42  *                                              instance.
43  */
44 jobject jhost_ref(JNIEnv* env,jobject jhost);
45 /**
46  * This function delete a global reference to a java host instance.
47  *
48  * @param                               The global refernce to delete.
49  * @param env                   The environment of the current thread
50  */
51 void jhost_unref(JNIEnv* env, jobject jhost);
52
53 /**
54  * This function associated a native host to a java host instance.
55  *
56  * @param jhost                 The java host instance.
57  * @param host                  The native host to bind.
58  * @param env                   The environment of the current thread
59  *
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.  
64  */             
65 void
66 jhost_bind(jobject jhost,m_host_t host,JNIEnv* env);
67
68 /**
69  * This function returns a native host from a java host instance.
70  *
71  * @param jhost                 The java host object from which get the native host.
72  * @param env                   The environment of the current thread
73  *
74  * @return                              The function returns the native host associated to the
75  *                                              java host object.
76  *
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.  
81  */
82 m_host_t
83 jhost_get_native(JNIEnv* env,jobject jhost);
84
85 /**
86  * This function returns the name of a MSG host.
87  *
88  * @param jhost                 A java host object.
89  * @param env                   The environment of the current thread
90  *
91  * @return                              The name of the host.
92  */
93 const char* 
94 jhost_get_name(jobject jhost,JNIEnv* env);
95
96
97 /**
98  * This function sets the name of a MSG host.
99  *
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
103  */
104 void
105 jhost_set_name(jobject jhost,jstring jname,JNIEnv* env);
106
107 /**
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.
110  *
111  * @param jhost                 The host to test the validity.
112  * @param env                   The environment of the current thread
113  *
114  * @return                              If the java host is valid the function returns true.
115  *                                              Otherwise the function returns false.
116  */
117 jboolean
118 jhost_is_valid(jobject jhost,JNIEnv* env);
119
120 #endif /*!MSG_JHOST_H */
121