/* Java Wrappers to the MSG API. */
-/* Copyright (c) 2007, 2008, 2009, 2010. The SimGrid Team.
+/* Copyright (c) 2007-2012. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
(*env)->GetJavaVM(env, &__java_vm);
if ((*env)->FindClass(env, "java/dyn/Coroutine")) {
- XBT_VERB("Using Coroutines");
+ XBT_INFO("Using Coroutines. Your simulation is on steroid.");
smx_factory_initializer_to_use = SIMIX_ctx_cojava_factory_init;
}
else {
- XBT_VERB("Using java threads");
+ XBT_INFO("Using regular java threads. Coroutines could speed your simulation up.");
smx_factory_initializer_to_use = SIMIX_ctx_java_factory_init;
}
jthrowable exc = (*env)->ExceptionOccurred(env);
xbt_dynar_free(&hosts);
XBT_INFO("Clean native world");
}
-JNIEXPORT void JNICALL
- JNICALL Java_org_simgrid_msg_Msg_clean(JNIEnv * env, jclass cls)
-{
- /* cleanup native stuff. Calling it is ... useless since leaking memory at the end of the simulation is a non-issue */
- msg_error_t rv = MSG_OK != MSG_clean();
- jxbt_check_res("MSG_clean()", rv, MSG_OK,
- bprintf
- ("unexpected error : MSG_clean() failed .. please report this bug "));
-}
JNIEXPORT void JNICALL
Java_org_simgrid_msg_Msg_createEnvironment(JNIEnv * env, jclass cls,
(*env)->ReleaseStringUTFChars(env, js, s);
}
JNIEXPORT void JNICALL
+Java_org_simgrid_msg_Msg_verb(JNIEnv * env, jclass cls, jstring js)
+{
+ const char *s = (*env)->GetStringUTFChars(env, js, 0);
+ XBT_VERB("%s", s);
+ (*env)->ReleaseStringUTFChars(env, js, s);
+}
+JNIEXPORT void JNICALL
Java_org_simgrid_msg_Msg_info(JNIEnv * env, jclass cls, jstring js)
{
const char *s = (*env)->GetStringUTFChars(env, js, 0);
XBT_INFO("%s", s);
(*env)->ReleaseStringUTFChars(env, js, s);
}
-
+JNIEXPORT void JNICALL
+Java_org_simgrid_msg_Msg_warn(JNIEnv * env, jclass cls, jstring js)
+{
+ const char *s = (*env)->GetStringUTFChars(env, js, 0);
+ XBT_WARN("%s", s);
+ (*env)->ReleaseStringUTFChars(env, js, s);
+}
+JNIEXPORT void JNICALL
+Java_org_simgrid_msg_Msg_error(JNIEnv * env, jclass cls, jstring js)
+{
+ const char *s = (*env)->GetStringUTFChars(env, js, 0);
+ XBT_ERROR("%s", s);
+ (*env)->ReleaseStringUTFChars(env, js, s);
+}
+JNIEXPORT void JNICALL
+Java_org_simgrid_msg_Msg_critical(JNIEnv * env, jclass cls, jstring js)
+{
+ const char *s = (*env)->GetStringUTFChars(env, js, 0);
+ XBT_CRITICAL("%s", s);
+ (*env)->ReleaseStringUTFChars(env, js, s);
+}
JNIEXPORT void JNICALL
Java_org_simgrid_msg_Msg_deployApplication(JNIEnv * env, jclass cls,
jstring jdeploymentFile)