Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
739a93060bc7a519700862ca4317cfee8262a111
[simgrid.git] / src / bindings / java / jmsg_storage.h
1 /* Functions related to the java storage API.                            */
2
3 /* Copyright (c) 2012-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_JSTORAGE_H
10 #define MSG_JSTORAGE_H
11 #include <jni.h>
12 #include "simgrid/msg.h"
13
14 SG_BEGIN_DECL()
15
16 /**
17  * This function returns a new java storage instance.
18  *
19  * @param env                   The environment of the current thread
20  *
21  * @return                              A new java storage object.
22  *
23  * @exception                   If the class Storage is not found the function throws
24  *                                              the ClassNotFoundException. If the constructor of
25  *                                              this class is not found the function throws the exception
26  *                                              NotSuchMethodException.
27  */
28 jobject jstorage_new_instance(JNIEnv * env);
29
30 /**
31  * This function associated a native storage to a java storage instance.
32  *
33  * @param jstorage                      The java storage instance.
34  * @param storage                       The native storage to bind.
35  * @param env                   The environment of the current thread
36  *
37  * @exception                   If the class Storage is not found the function throws
38  *                                              the ClassNotFoundException. If the field bind of
39  *                                              this class is not found the function throws the exception
40  *                                              NotSuchFieldException.
41  */
42 void jstorage_bind(jobject jstorage, msg_storage_t storage, JNIEnv * env);
43
44
45 /**
46  * This function returns a native storage from a java storage instance.
47  *
48  * @param jstorage                      The java storage object from which get the native storage.
49  * @param env                   The environment of the current thread
50  *
51  * @return                              The function returns the native storage associated to the
52  *                                              java storage object.
53  *
54  * @exception                   If the class Storage is not found the function throws
55  *                                              the ClassNotFoundException. If the field bind of
56  *                                              this class is not found the function throws the exception
57  *                                              NotSuchFieldException.
58  */
59 msg_storage_t jstorage_get_native(JNIEnv * env, jobject jstorage);
60
61
62 /**
63  * Class                        org_simgrid_msg_Storage
64  * Method                       nativeInit
65  * Signature    ()V
66  */
67 JNIEXPORT void JNICALL
68 Java_org_simgrid_msg_Storage_nativeInit(JNIEnv*, jclass);
69
70
71 /**
72  * This function returns a global reference to the  java storage instance
73  * specified by the parameter jstorage.
74  *
75  * @param jstorage                      The original java storage instance.
76  * @param env                   The environment of the current thread
77  *
78  * @return                              The global reference to the original java storage
79  *                                              instance.
80  */
81 jobject jstorage_ref(JNIEnv * env, jobject jstorage);
82 /**
83  * This function delete a global reference to a java storage instance.
84  *
85  * @param                               The global reference to delete.
86  * @param env                   The environment of the current thread
87  */
88 void jstorage_unref(JNIEnv * env, jobject jstorage);
89
90 /**
91  * This function returns the name of a MSG storage.
92  *
93  * @param jstorage                      A java storage object.
94  * @param env                   The environment of the current thread
95  *
96  * @return                              The name of the storage.
97  */
98 const char *jstorage_get_name(jobject jstorage, JNIEnv * env);
99
100 /*
101  * Class                org_simgrid_msg_Storage
102  * Method               getByName
103  * Signature    (Ljava/lang/String;)Lsimgrid/msg/Storage;
104  */
105 JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Storage_getByName(JNIEnv *, jclass, jstring);
106
107 /*
108  * Class                org_simgrid_msg_Storage
109  * Method               getSize
110  * Signature    ()D
111  */
112 JNIEXPORT jlong JNICALL Java_org_simgrid_msg_Storage_getSize(JNIEnv *, jobject);
113
114 /*
115  * Class                org_simgrid_msg_Storage
116  * Method               getFreeSize
117  * Signature    ()D
118  */
119 JNIEXPORT jlong JNICALL Java_org_simgrid_msg_Storage_getFreeSize(JNIEnv *, jobject);
120
121 /*
122  * Class                org_simgrid_msg_Storage
123  * Method               getUsedSize
124  * Signature    ()D
125  */
126 JNIEXPORT jlong JNICALL Java_org_simgrid_msg_Storage_getUsedSize(JNIEnv *, jobject);
127
128 /*
129  * Class        org_simgrid_msg_Storage
130  * Method       getProperty
131  * Signature    (Ljava/lang/String;)Ljava/lang/String;
132  */
133 JNIEXPORT jobject JNICALL
134 Java_org_simgrid_msg_Storage_getProperty(JNIEnv *env, jobject jstorage, jobject jname);
135 /*
136  * Class        org_simgrid_msg_Storage
137  * Method       setProperty
138  * Signature    (Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
139  */
140 JNIEXPORT void JNICALL
141 Java_org_simgrid_msg_Storage_setProperty(JNIEnv *env, jobject jstorage, jobject jname, jobject jvalue);
142
143 /*
144  * Class        org_simgrid_msg_Storage
145  * Method       getHost
146  * Signature    (Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
147  */
148 JNIEXPORT jobject JNICALL
149 Java_org_simgrid_msg_Storage_getHost(JNIEnv * env,jobject jstorage);
150
151 /**
152  * Class org_simgrid_msg_Storage
153  * Method all
154  */
155 JNIEXPORT jobjectArray JNICALL
156 Java_org_simgrid_msg_Storage_all(JNIEnv *, jclass);
157
158 SG_END_DECL()
159
160 #endif                          /*!MSG_JSTORAGE_H */