/* Java bindings of the Storage API. */
-/* Copyright (c) 2012-2017. The SimGrid Team. All rights reserved. */
+/* Copyright (c) 2012-2020. The SimGrid Team. All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
#include "simgrid/msg.h"
+#include "simgrid/plugins/file_system.h"
#include "include/xbt/signal.hpp"
#include "jmsg.hpp"
XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(java);
-extern "C" {
-
static jmethodID jstorage_method_Storage_constructor;
static jfieldID jstorage_field_Storage_bind;
static jfieldID jstorage_field_Storage_name;
}
JNIEXPORT jlong JNICALL Java_org_simgrid_msg_Storage_getSize(JNIEnv * env,jobject jstorage) {
- msg_storage_t storage = jstorage_get_native(env, jstorage);
+ const_sg_storage_t storage = jstorage_get_native(env, jstorage);
if (not storage) {
jxbt_throw_notbound(env, "storage", jstorage);
}
JNIEXPORT jlong JNICALL Java_org_simgrid_msg_Storage_getFreeSize(JNIEnv * env,jobject jstorage) {
- msg_storage_t storage = jstorage_get_native(env, jstorage);
+ const_sg_storage_t storage = jstorage_get_native(env, jstorage);
if (not storage) {
jxbt_throw_notbound(env, "storage", jstorage);
}
JNIEXPORT jlong JNICALL Java_org_simgrid_msg_Storage_getUsedSize(JNIEnv * env,jobject jstorage) {
- msg_storage_t storage = jstorage_get_native(env, jstorage);
+ const_sg_storage_t storage = jstorage_get_native(env, jstorage);
if (not storage) {
jxbt_throw_notbound(env, "storage", jstorage);
}
JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Storage_getProperty(JNIEnv *env, jobject jstorage, jobject jname) {
- msg_storage_t storage = jstorage_get_native(env, jstorage);
+ const_sg_storage_t storage = jstorage_get_native(env, jstorage);
if (not storage) {
jxbt_throw_notbound(env, "storage", jstorage);
const char *name = env->GetStringUTFChars((jstring) jname, 0);
const char *value_java = env->GetStringUTFChars((jstring) jvalue, 0);
- storage->setProperty(name, std::string(value_java));
+ storage->set_property(name, std::string(value_java));
env->ReleaseStringUTFChars((jstring) jvalue, value_java);
env->ReleaseStringUTFChars((jstring) jname, name);
-
}
JNIEXPORT jobject JNICALL Java_org_simgrid_msg_Storage_getHost(JNIEnv * env,jobject jstorage) {
- msg_storage_t storage = jstorage_get_native(env, jstorage);
+ const_sg_storage_t storage = jstorage_get_native(env, jstorage);
if (not storage) {
jxbt_throw_notbound(env, "storage", jstorage);
xbt_dynar_free(&table);
return jtable;
}
-}