Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
throw the right exception corresponding to TimeoutFailureException
[simgrid.git] / src / java / jxbt_utilities.c
index 0a4ea4b..da844c8 100644 (file)
@@ -102,7 +102,6 @@ jmethodID jxbt_get_static_smethod(JNIEnv * env, const char *classname,
 {
 
   jclass cls;
-
   jmethodID id;
   cls = jxbt_get_class(env, classname);
 
@@ -129,7 +128,6 @@ jmethodID jxbt_get_smethod(JNIEnv * env, const char *classname,
 {
 
   jclass cls;
-
   jmethodID id;
   cls = jxbt_get_class(env, classname);
 
@@ -246,7 +244,6 @@ void jxbt_throw_null(JNIEnv * env, char *msg)
   jxbt_throw_by_name(env, "java/lang/NullPointerException", msg);
 }
 
-
 /* Errors on user side */
 void jxbt_throw_illegal(JNIEnv * env, char *msg)
 {
@@ -266,3 +263,33 @@ void jxbt_throw_process_not_found(JNIEnv * env, const char *invalid_name)
                      "simgrid/msg/ProcessNotFoundException",
                      bprintf("No such process: %s", invalid_name));
 }
+
+// tranfert failure
+void jxbt_throw_transfer_failure(JNIEnv *env,const char *task_name,const char *alias)
+{
+  
+  jxbt_throw_by_name(env,
+                    "simgrid/msg/TransferFailureException",
+                    bprintf("There has been a problem during your task transfer (task :%s / alias :%s)",task_name,alias));
+  
+}
+
+// host failure Exception
+void jxbt_throw_host_failure(JNIEnv *env,const char *task_name,const char *alias)
+{
+  
+ jxbt_throw_by_name(env,
+                   "simgrid/msg/HostFailureException",
+                   bprintf("Host Failure while sending (task :%s / alias %s) : The host on which you are running has just been rebooted",task_name,alias));
+  
+}
+
+// time out failure Exception
+void jxbt_throw_time_out_failure(JNIEnv *env,const char *task_name,const char *alias)
+{
+  
+  jxbt_throw_by_name(env,
+                   "simgrid/msg/TimeoutFailureException",
+                   bprintf("Timeout Failure while sending(task :%s / alias %s ):nothing good happened before the timer you provided elapsed ",task_name,alias));
+  
+}
\ No newline at end of file