Logo AND Algorithmique Numérique Distribuée

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