1 /* Functions related to the java host instances. */
3 /* Copyright (c) 2007-2015. The SimGrid Team.
4 * All rights 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. */
13 #include "simgrid/msg.h"
18 * This function returns a new java host instance.
20 * @param env The environment of the current thread
22 * @return A new java host object.
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.
29 jobject jhost_new_instance(JNIEnv * env);
32 * This function returns a global reference to the java host instance
33 * specified by the parameter jhost.
35 * @param jhost The original java host instance.
36 * @param env The environment of the current thread
38 * @return The global reference to the original java host
41 jobject jhost_ref(JNIEnv * env, jobject jhost);
43 * This function delete a global reference to a java host instance.
45 * @param The global refernce to delete.
46 * @param env The environment of the current thread
48 void jhost_unref(JNIEnv * env, jobject jhost);
51 * This function associated a native host to a java host instance.
53 * @param jhost The java host instance.
54 * @param host The native host to bind.
55 * @param env The environment of the current thread
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.
62 void jhost_bind(jobject jhost, msg_host_t host, JNIEnv * env);
65 * This function returns a native host from a java host instance.
67 * @param jhost The java host object from which get the native host.
68 * @param env The environment of the current thread
70 * @return The function returns the native host associated to the
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.
78 msg_host_t jhost_get_native(JNIEnv * env, jobject jhost);
81 * This function returns the name of a MSG host.
83 * @param jhost A java host object.
84 * @param env The environment of the current thread
86 * @return The name of the host.
88 const char *jhost_get_name(jobject jhost, JNIEnv * env);
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.
94 * @param jhost The host to test the validity.
95 * @param env The environment of the current thread
97 * @return If the java host is valid the function returns true.
98 * Otherwise the function returns false.
100 jboolean jhost_is_valid(jobject jhost, JNIEnv * env);
102 * Class org_simgrid_msg_Host
106 JNIEXPORT void JNICALL
107 Java_org_simgrid_msg_Host_nativeInit(JNIEnv *env, jclass cls);
110 * Class org_simgrid_msg_Host
112 * Signature (Ljava/lang/String;)Lsimgrid/msg/Host;
114 JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Host_getByName
115 (JNIEnv *, jclass, jstring);
118 * This function start the host if it is off
120 * @param jhost The host to test the validity.
121 * @param env The environment of the current thread
124 JNIEXPORT void JNICALL Java_org_simgrid_msg_Host_on(JNIEnv *env, jobject jhost);
127 * This function stop the host if it is on
129 * @param jhost The host to test the validity.
130 * @param env The environment of the current thread
133 JNIEXPORT void JNICALL Java_org_simgrid_msg_Host_off(JNIEnv *env, jobject jhost);
136 * Class org_simgrid_msg_Host
138 * Signature ()Lsimgrid/msg/Host;
140 JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Host_currentHost
143 * Class org_simgrid_msg_Host
147 JNIEXPORT jint JNICALL Java_org_simgrid_msg_Host_getCount
151 * Class org_simgrid_msg_Host
155 JNIEXPORT jdouble JNICALL Java_org_simgrid_msg_Host_getSpeed
158 * Class org_simgrid_msg_Host
159 * Method getCoreNumber
162 JNIEXPORT jdouble JNICALL Java_org_simgrid_msg_Host_getCoreNumber
165 * Class org_simgrid_msg_Host
169 JNIEXPORT jint JNICALL
170 Java_org_simgrid_msg_Host_getLoad(JNIEnv * env,
173 * Class org_simgrid_msg_Host
175 * Signature (Ljava/lang/String;)Ljava/lang/String;
177 JNIEXPORT jobject JNICALL
178 Java_org_simgrid_msg_Host_getProperty(JNIEnv *env, jobject jhost, jobject jname);
180 * Class org_simgrid_msg_Host
182 * Signature (Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
184 JNIEXPORT void JNICALL
185 Java_org_simgrid_msg_Host_setProperty(JNIEnv *env, jobject jhost, jobject jname, jobject jvalue);
187 * Class org_simgrid_msg_Host
191 JNIEXPORT jboolean JNICALL Java_org_simgrid_msg_Host_isOn
196 * Class org_simgrid_msg_Host
197 * Method getMountedStorage
198 * Signature: ()[Lorg/simgrid/msg/Storage;
200 JNIEXPORT jobjectArray JNICALL Java_org_simgrid_msg_Host_getMountedStorage(JNIEnv * env, jobject jhost);
203 * Class org_simgrid_msg_Host
204 * Method getAttachedStorageList
206 JNIEXPORT jobjectArray JNICALL Java_org_simgrid_msg_Host_getAttachedStorage(JNIEnv * env, jobject jhost);
209 * Class org_simgrid_msg_Host
210 * Method getStorageContent
212 JNIEXPORT jobjectArray JNICALL Java_org_simgrid_msg_Host_getStorageContent(JNIEnv * env, jobject jhost);
216 * Class org_simgrid_msg_Host
219 JNIEXPORT jobjectArray JNICALL
220 Java_org_simgrid_msg_Host_all(JNIEnv *, jclass);
222 JNIEXPORT void JNICALL
223 Java_org_simgrid_msg_Host_setAsyncMailbox(JNIEnv * env, jclass cls_arg, jobject jname);
227 #endif /*!MSG_JHOST_H */