X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/45c3f1cfee86fb48c96d53f8267f99b6db6e3d7a..5a97de8c98502af9f74cfceb924fa02e0fd80925:/src/bindings/java/org/simgrid/msg/VM.java diff --git a/src/bindings/java/org/simgrid/msg/VM.java b/src/bindings/java/org/simgrid/msg/VM.java index f77a4af1ed..b858c49694 100644 --- a/src/bindings/java/org/simgrid/msg/VM.java +++ b/src/bindings/java/org/simgrid/msg/VM.java @@ -147,14 +147,21 @@ public class VM extends Host{ /** * Invoke native migration routine */ - public native void internalmig(Host destination); + public native void internalmig(Host destination) throws Exception; // TODO add throws DoubleMigrationException (i.e. when you call migrate on a VM that is already migrating); + /** Change the host on which all processes are running * (pre-copy is implemented) */ - public void migrate(Host destination){ - this.internalmig(destination); + public void migrate(Host destination) throws HostFailureException{ + try { + this.internalmig(destination); + } catch (Exception e){ + Msg.info("an exception occurs during the migration of VM "+this.getName()); + throw new HostFailureException(); + } + // If the migration correcly returned, then we should change the currentHost value. this.currentHost = destination; }