Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'coverity_scan' of github.com:mquinson/simgrid
[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       getProperty
167  * Signature    (Ljava/lang/String;)Ljava/lang/String;
168  */
169 JNIEXPORT jobject JNICALL
170 Java_org_simgrid_msg_Host_getProperty(JNIEnv *env, jobject jhost, jobject jname);
171 /*
172  * Class        org_simgrid_msg_Host
173  * Method       setProperty
174  * Signature    (Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
175  */
176 JNIEXPORT void JNICALL
177 Java_org_simgrid_msg_Host_setProperty(JNIEnv *env, jobject jhost, jobject jname, jobject jvalue);
178 /*
179  * Class    org_simgrid_msg_Host
180  * Method    isOn
181  * Signature  ()Z
182  */
183 JNIEXPORT jboolean JNICALL Java_org_simgrid_msg_Host_isOn
184     (JNIEnv *, jobject);
185
186
187 /*
188  * Class    org_simgrid_msg_Host
189  * Method    getMountedStorage
190  * Signature: ()[Lorg/simgrid/msg/Storage;
191  */
192 JNIEXPORT jobjectArray JNICALL Java_org_simgrid_msg_Host_getMountedStorage(JNIEnv * env, jobject jhost);
193
194 /*
195  * Class    org_simgrid_msg_Host
196  * Method    getAttachedStorageList
197  */
198 JNIEXPORT jobjectArray JNICALL Java_org_simgrid_msg_Host_getAttachedStorage(JNIEnv * env, jobject jhost);
199
200 /*
201  * Class    org_simgrid_msg_Host
202  * Method    getStorageContent
203  */
204 JNIEXPORT jobjectArray JNICALL Java_org_simgrid_msg_Host_getStorageContent(JNIEnv * env, jobject jhost);
205
206
207 /**
208  * Class org_simgrid_msg_Host
209  * Method all
210  */
211 JNIEXPORT jobjectArray JNICALL
212 Java_org_simgrid_msg_Host_all(JNIEnv *, jclass);
213
214 JNIEXPORT void JNICALL 
215 Java_org_simgrid_msg_Host_setAsyncMailbox(JNIEnv * env, jclass cls_arg, jobject jname);
216
217 JNIEXPORT jdouble JNICALL Java_org_simgrid_msg_Host_getConsumedEnergy
218     (JNIEnv *, jobject);
219
220
221 #endif                          /*!MSG_JHOST_H */
222
223 SG_END_DECL()