X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/281f8c29e177852dcb1591fc31e363e1176857c8..44ae89a4ce99e7fdc43dc735cda8e4621f5ef265:/src/bindings/java/jmsg_vm.c diff --git a/src/bindings/java/jmsg_vm.c b/src/bindings/java/jmsg_vm.c index 2df6a935a6..e508db122a 100644 --- a/src/bindings/java/jmsg_vm.c +++ b/src/bindings/java/jmsg_vm.c @@ -1,10 +1,12 @@ /* Functions related to the MSG VM API. */ -/* Copyright (c) 2012-2013. The SimGrid Team. +/* Copyright (c) 2012-2014. 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 "jmsg.h" #include "jmsg_vm.h" #include "jmsg_host.h" #include "jmsg_process.h" @@ -156,7 +158,7 @@ Java_org_simgrid_msg_VM_get_pm(JNIEnv *env, jobject jvm) { msg_vm_t vm = jvm_get_native(env,jvm); msg_host_t host = MSG_vm_get_pm(vm); - if (!MSG_host_get_data(host)) { + if (!xbt_lib_get_level(host, JAVA_HOST_LEVEL)) { /* the native host not yet associated with the java host instance */ /* instanciate a new java host instance */ @@ -180,9 +182,9 @@ Java_org_simgrid_msg_VM_get_pm(JNIEnv *env, jobject jvm) { (*env)->SetObjectField(env, jhost, jxbt_get_jfield(env, (*env)->FindClass(env, "org/simgrid/msg/Host"), "name", "Ljava/lang/String;"), jname); /* Bind & store it */ jhost_bind(jhost, host, env); - MSG_host_set_data(host, (void *) jhost); + xbt_lib_set(host_lib, host->key, JAVA_HOST_LEVEL, (void *) jhost); } else { - jhost = (jobject) MSG_host_get_data(host); + jhost = (jobject) xbt_lib_get_level(host, JAVA_HOST_LEVEL); } return jhost;