+
+ rv = MSG_task_send_with_timeout(task, alias, (double) jtimeout);
+
+ (*env)->ReleaseStringUTFChars(env, jalias, alias);
+
+ /* FIXME throw the right exception corresponding to HostFailureException, TransferFailureException, TimeoutFailureException
+ * Note: these exceptions must be created beforehand
+ * then, you want to create some functions like jxbt_throw_notbound()
+ * then, you must declare in the MsgNative stuff that these native functions can throw these exceptions
+ */
+ if (MSG_OK != rv)
+ jxbt_throw_native(env, xbt_strdup("MSG_task_send_with_timeout() failed"));
+
+}
+
+JNIEXPORT void JNICALL
+Java_simgrid_msg_MsgNative_taskSendBounded(JNIEnv * env, jclass cls,
+ jstring jalias, jobject jtask,
+ jdouble jmaxRate)
+{
+ m_task_t task = jtask_to_native_task(jtask, env);
+ MSG_error_t rv;
+ const char *alias;
+
+ if (!task) {
+ jxbt_throw_notbound(env, "task", jtask);