Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
let the decoupling of main lib and bindings work in supernovae (were multiple definit...
[simgrid.git] / src / java / jmsg.c
index 43dc519..57367ff 100644 (file)
@@ -813,6 +813,8 @@ Java_simgrid_msg_Msg_init(JNIEnv * env, jclass cls, jobjectArray jargs)
   jstring jval;
   const char *tmp;
 
+  factory_initializer_to_use = SIMIX_ctx_java_factory_init;
+
   if (jargs)
     argc = (int) (*env)->GetArrayLength(env, jargs);
 
@@ -828,7 +830,6 @@ Java_simgrid_msg_Msg_init(JNIEnv * env, jclass cls, jobjectArray jargs)
   }
 
   MSG_global_init(&argc, argv);
-  SIMIX_context_select_factory("java");
 
   for (index = 0; index < argc; index++)
     free(argv[index]);
@@ -960,34 +961,6 @@ Java_simgrid_msg_MsgNative_allHosts(JNIEnv * env, jclass cls_arg)
   return jtable;
 }
 
-
-JNIEXPORT void JNICALL
-Java_simgrid_msg_MsgNative_selectContextFactory(JNIEnv * env, jclass class,
-                                                jstring jname)
-{
-  char *errmsg = NULL;
-  xbt_ex_t e;
-
-  /* get the C string from the java string */
-  const char *name = (*env)->GetStringUTFChars(env, jname, 0);
-
-  TRY {
-    SIMIX_context_select_factory(name);
-  } CATCH(e) {
-    errmsg = xbt_strdup(e.msg);
-    xbt_ex_free(e);
-  }
-
-  (*env)->ReleaseStringUTFChars(env, jname, name);
-
-  if (errmsg) {
-    char *thrown =
-        bprintf("xbt_select_context_factory() failed: %s", errmsg);
-    free(errmsg);
-    jxbt_throw_jni(env, thrown);
-  }
-}
-
 JNIEXPORT void JNICALL
 Java_simgrid_msg_MsgNative_taskSend(JNIEnv * env, jclass cls,
                                     jstring jalias, jobject jtask,