/* 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"
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 */
(*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;