Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
cleanups to the java actors
[simgrid.git] / src / bindings / java / jmsg_storage.h
1 /* Java bindings of the Storage API.                                        */
2
3 /* Copyright (c) 2012-2017. The SimGrid Team. All rights reserved.          */
4
5 /* This program is free software; you can redistribute it and/or modify it
6  * under the terms of the license (GNU LGPL) which comes with this package. */
7
8 #ifndef MSG_JSTORAGE_H
9 #define MSG_JSTORAGE_H
10
11 #include "simgrid/msg.h"
12 #include <jni.h>
13
14 SG_BEGIN_DECL()
15
16 /** Returns a new java instance of a storage. */
17 jobject jstorage_new_instance(JNIEnv * env);
18
19 /** Binds a native instance to a java instance. */
20 void jstorage_bind(jobject jstorage, msg_storage_t storage, JNIEnv * env);
21
22 /** Extracts the native instance associated to a java instance. */
23 msg_storage_t jstorage_get_native(JNIEnv * env, jobject jstorage);
24
25 /** Initialize the native world, called from the Java world at startup */
26 JNIEXPORT void JNICALL Java_org_simgrid_msg_Storage_nativeInit(JNIEnv *env, jclass cls);
27
28 /** Take a ref onto the java instance (to prevent its collection) */
29 jobject jstorage_ref(JNIEnv * env, jobject jstorage);
30
31 /** Release a ref onto the java instance */
32 void jstorage_unref(JNIEnv * env, jobject jstorage);
33
34 /** Get the name of a java instance. */
35 const char *jstorage_get_name(jobject jstorage, JNIEnv * env);
36
37 /* Implement the Java API */
38
39 JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Storage_getByName(JNIEnv* env, jclass cls, jstring jname);
40 JNIEXPORT jlong JNICALL Java_org_simgrid_msg_Storage_getSize(JNIEnv *env, jobject jstorage);
41 JNIEXPORT jlong JNICALL Java_org_simgrid_msg_Storage_getFreeSize(JNIEnv *env, jobject jstorage);
42 JNIEXPORT jlong JNICALL Java_org_simgrid_msg_Storage_getUsedSize(JNIEnv *env, jobject jstorage);
43 JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Storage_getProperty(JNIEnv *env, jobject jstorage, jobject jname);
44 JNIEXPORT void JNICALL Java_org_simgrid_msg_Storage_setProperty(JNIEnv* env, jobject jstorage, jobject jname,
45                                                                 jobject jvalue);
46 JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Storage_getHost(JNIEnv * env,jobject jstorage);
47 JNIEXPORT jobjectArray JNICALL Java_org_simgrid_msg_Storage_all(JNIEnv *env, jclass cls);
48
49 SG_END_DECL()
50 #endif                          /*!MSG_JSTORAGE_H */