+
+JNIEXPORT jobject JNICALL
+Java_org_simgrid_msg_Msg_environmentGetRoutingRoot(JNIEnv * env, jclass cls)
+{
+ msg_as_t as = MSG_environment_get_routing_root();
+ jobject jas = jas_new_instance(env);
+ if (!jas) {
+ jxbt_throw_jni(env, "java As instantiation failed");
+ return NULL;
+ }
+ jas = jas_ref(env, jas);
+ if (!jas) {
+ jxbt_throw_jni(env, "new global ref allocation failed");
+ return NULL;
+ }
+ jas_bind(jas, as, env);
+
+ return (jobject) jas;
+}
+