1 /* Java bindings of the Storage API. */
3 /* Copyright (c) 2012-2019. The SimGrid Team. All rights reserved. */
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. */
11 #include "simgrid/msg.h"
16 /** Returns a new java instance of a storage. */
17 jobject jstorage_new_instance(JNIEnv * env);
19 /** Binds a native instance to a java instance. */
20 void jstorage_bind(jobject jstorage, msg_storage_t storage, JNIEnv * env);
22 /** Extracts the native instance associated to a java instance. */
23 msg_storage_t jstorage_get_native(JNIEnv * env, jobject jstorage);
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);
28 /** Take a ref onto the java instance (to prevent its collection) */
29 jobject jstorage_ref(JNIEnv * env, jobject jstorage);
31 /** Release a ref onto the java instance */
32 void jstorage_unref(JNIEnv * env, jobject jstorage);
34 /* Implement the Java API */
36 JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Storage_getByName(JNIEnv* env, jclass cls, jstring jname);
37 JNIEXPORT jlong JNICALL Java_org_simgrid_msg_Storage_getSize(JNIEnv *env, jobject jstorage);
38 JNIEXPORT jlong JNICALL Java_org_simgrid_msg_Storage_getFreeSize(JNIEnv *env, jobject jstorage);
39 JNIEXPORT jlong JNICALL Java_org_simgrid_msg_Storage_getUsedSize(JNIEnv *env, jobject jstorage);
40 JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Storage_getProperty(JNIEnv *env, jobject jstorage, jobject jname);
41 JNIEXPORT void JNICALL Java_org_simgrid_msg_Storage_setProperty(JNIEnv* env, jobject jstorage, jobject jname,
43 JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Storage_getHost(JNIEnv * env,jobject jstorage);
44 JNIEXPORT jobjectArray JNICALL Java_org_simgrid_msg_Storage_all(JNIEnv *env, jclass cls);