Logo AND Algorithmique Numérique Distribuée

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