Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
kill an unimplemented function. Fix #14
[simgrid.git] / src / bindings / java / jmsg_host.h
1 /* Functions related to the java host instances.                            */
2
3 /* Copyright (c) 2007-2015. The SimGrid Team.
4  * All rights 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 #ifndef MSG_JHOST_H
10 #define MSG_JHOST_H
11
12 #include <jni.h>
13 #include "simgrid/msg.h"
14
15 SG_BEGIN_DECL()
16
17 /**
18  * This function returns a new java host instance.
19  *
20  * @param env                   The environment of the current thread
21  *
22  * @return                              A new java host object.
23  *
24  * @exception                   If the class Host is not found the function throws 
25  *                                              the ClassNotFoundException. If the constructor of 
26  *                                              this class is not found the function throws the exception 
27  *                                              NotSuchMethodException.
28  */
29 jobject jhost_new_instance(JNIEnv * env);
30
31 /**
32  * This function returns a global reference to the  java host instance 
33  * specified by the parameter jhost.
34  *
35  * @param jhost                 The original java host instance.
36  * @param env                   The environment of the current thread
37  *
38  * @return                              The global reference to the original java host 
39  *                                              instance.
40  */
41 jobject jhost_ref(JNIEnv * env, jobject jhost);
42 /**
43  * This function delete a global reference to a java host instance.
44  *
45  * @param                               The global refernce to delete.
46  * @param env                   The environment of the current thread
47  */
48 void jhost_unref(JNIEnv * env, jobject jhost);
49
50 /**
51  * This function associated a native host to a java host instance.
52  *
53  * @param jhost                 The java host instance.
54  * @param host                  The native host to bind.
55  * @param env                   The environment of the current thread
56  *
57  * @exception                   If the class Host is not found the function throws 
58  *                                              the ClassNotFoundException. If the field bind of 
59  *                                              this class is not found the function throws the exception 
60  *                                              NotSuchFieldException.  
61  */
62 void jhost_bind(jobject jhost, msg_host_t host, JNIEnv * env);
63
64 /**
65  * This function returns a native host from a java host instance.
66  *
67  * @param jhost                 The java host object from which get the native host.
68  * @param env                   The environment of the current thread
69  *
70  * @return                              The function returns the native host associated to the
71  *                                              java host object.
72  *
73  * @exception                   If the class Host is not found the function throws 
74  *                                              the ClassNotFoundException. If the field bind of 
75  *                                              this class is not found the function throws the exception 
76  *                                              NotSuchFieldException.  
77  */
78 msg_host_t jhost_get_native(JNIEnv * env, jobject jhost);
79
80 /**
81  * This function returns the name of a MSG host.
82  *
83  * @param jhost                 A java host object.
84  * @param env                   The environment of the current thread
85  *
86  * @return                              The name of the host.
87  */
88 const char *jhost_get_name(jobject jhost, JNIEnv * env);
89
90 /**
91  * This function tests if a java host instance is valid.
92  * A java host object is valid if it is bind to a native host.
93  *
94  * @param jhost                 The host to test the validity.
95  * @param env                   The environment of the current thread
96  *
97  * @return                              If the java host is valid the function returns true.
98  *                                              Otherwise the function returns false.
99  */
100 jboolean jhost_is_valid(jobject jhost, JNIEnv * env);
101 /*
102  * Class                org_simgrid_msg_Host
103  * Method               nativeInit
104  * Signature    ();
105  */
106 JNIEXPORT void JNICALL
107 Java_org_simgrid_msg_Host_nativeInit(JNIEnv *env, jclass cls);
108
109 /*
110  * Class                org_simgrid_msg_Host
111  * Method               getByName
112  * Signature    (Ljava/lang/String;)Lsimgrid/msg/Host;
113  */
114 JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Host_getByName
115     (JNIEnv *, jclass, jstring);
116
117 /**
118  * This function start the host if it is off
119  *
120  * @param jhost                 The host to test the validity.
121  * @param env                   The environment of the current thread
122  *
123  */
124 JNIEXPORT void JNICALL Java_org_simgrid_msg_Host_on(JNIEnv *env, jobject jhost);
125
126 /**
127  * This function stop the host if it is on
128  *
129  * @param jhost                 The host to test the validity.
130  * @param env                   The environment of the current thread
131  *
132  */
133 JNIEXPORT void JNICALL Java_org_simgrid_msg_Host_off(JNIEnv *env, jobject jhost);
134
135 /*
136  * Class                org_simgrid_msg_Host
137  * Method               currentHost
138  * Signature    ()Lsimgrid/msg/Host;
139  */
140 JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Host_currentHost
141     (JNIEnv *, jclass);
142 /*
143  * Class                org_simgrid_msg_Host
144  * Method               getCount
145  * Signature    ()I
146  */
147 JNIEXPORT jint JNICALL Java_org_simgrid_msg_Host_getCount
148     (JNIEnv *, jclass);
149
150 /*
151  * Class                org_simgrid_msg_Host
152  * Method               getSpeed
153  * Signature    ()D
154  */
155 JNIEXPORT jdouble JNICALL Java_org_simgrid_msg_Host_getSpeed
156     (JNIEnv *, jobject);
157 /*
158  * Class                org_simgrid_msg_Host
159  * Method               getCoreNumber
160  * Signature    ()D
161  */
162 JNIEXPORT jdouble JNICALL Java_org_simgrid_msg_Host_getCoreNumber
163     (JNIEnv *, jobject);
164 /*
165  * Class                org_simgrid_msg_Host
166  * Method               getLoad
167  * Signature    ()I
168  */
169 JNIEXPORT jint JNICALL
170 Java_org_simgrid_msg_Host_getLoad(JNIEnv * env,
171                                        jobject jhost);
172 /*
173  * Class        org_simgrid_msg_Host
174  * Method       getProperty
175  * Signature    (Ljava/lang/String;)Ljava/lang/String;
176  */
177 JNIEXPORT jobject JNICALL
178 Java_org_simgrid_msg_Host_getProperty(JNIEnv *env, jobject jhost, jobject jname);
179 /*
180  * Class        org_simgrid_msg_Host
181  * Method       setProperty
182  * Signature    (Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
183  */
184 JNIEXPORT void JNICALL
185 Java_org_simgrid_msg_Host_setProperty(JNIEnv *env, jobject jhost, jobject jname, jobject jvalue);
186 /*
187  * Class                org_simgrid_msg_Host
188  * Method               isOn
189  * Signature    ()Z
190  */
191 JNIEXPORT jboolean JNICALL Java_org_simgrid_msg_Host_isOn
192     (JNIEnv *, jobject);
193
194
195 /*
196  * Class                org_simgrid_msg_Host
197  * Method               getMountedStorage
198  * Signature: ()[Lorg/simgrid/msg/Storage;
199  */
200 JNIEXPORT jobjectArray JNICALL Java_org_simgrid_msg_Host_getMountedStorage(JNIEnv * env, jobject jhost);
201
202 /*
203  * Class                org_simgrid_msg_Host
204  * Method               getAttachedStorageList
205  */
206 JNIEXPORT jobjectArray JNICALL Java_org_simgrid_msg_Host_getAttachedStorage(JNIEnv * env, jobject jhost);
207
208 /*
209  * Class                org_simgrid_msg_Host
210  * Method               getStorageContent
211  */
212 JNIEXPORT jobjectArray JNICALL Java_org_simgrid_msg_Host_getStorageContent(JNIEnv * env, jobject jhost);
213
214
215 /**
216  * Class org_simgrid_msg_Host
217  * Method all
218  */
219 JNIEXPORT jobjectArray JNICALL
220 Java_org_simgrid_msg_Host_all(JNIEnv *, jclass);
221
222 JNIEXPORT void JNICALL 
223 Java_org_simgrid_msg_Host_setAsyncMailbox(JNIEnv * env, jclass cls_arg, jobject jname);
224
225
226
227 #endif                          /*!MSG_JHOST_H */
228
229 SG_END_DECL()