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
167 * Signature (Ljava/lang/String;)Ljava/lang/String;
169 JNIEXPORT jobject JNICALL
170 Java_org_simgrid_msg_Host_getProperty(JNIEnv *env, jobject jhost, jobject jname);
172 * Class org_simgrid_msg_Host
174 * Signature (Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
176 JNIEXPORT void JNICALL
177 Java_org_simgrid_msg_Host_setProperty(JNIEnv *env, jobject jhost, jobject jname, jobject jvalue);
179 * Class org_simgrid_msg_Host
183 JNIEXPORT jboolean JNICALL Java_org_simgrid_msg_Host_isOn
188 * Class org_simgrid_msg_Host
189 * Method getMountedStorage
190 * Signature: ()[Lorg/simgrid/msg/Storage;
192 JNIEXPORT jobjectArray JNICALL Java_org_simgrid_msg_Host_getMountedStorage(JNIEnv * env, jobject jhost);
195 * Class org_simgrid_msg_Host
196 * Method getAttachedStorageList
198 JNIEXPORT jobjectArray JNICALL Java_org_simgrid_msg_Host_getAttachedStorage(JNIEnv * env, jobject jhost);
201 * Class org_simgrid_msg_Host
202 * Method getStorageContent
204 JNIEXPORT jobjectArray JNICALL Java_org_simgrid_msg_Host_getStorageContent(JNIEnv * env, jobject jhost);
208 * Class org_simgrid_msg_Host
211 JNIEXPORT jobjectArray JNICALL
212 Java_org_simgrid_msg_Host_all(JNIEnv *, jclass);
214 JNIEXPORT void JNICALL
215 Java_org_simgrid_msg_Host_setAsyncMailbox(JNIEnv * env, jclass cls_arg, jobject jname);
219 #endif /*!MSG_JHOST_H */