//<editor-fold desc="Lifecycle">
/////////// Lifecycle ///////////////////////////////////
final V run0() throws InterruptedException, SuspendExecution {
JMXActorsMonitor.getInstance().actorStarted(ref);
final Strand strand = runner.getStrand(); // runner might be nulled by running actor
if (!strand.isFiber())
currentActor.set(this);
try {
if (this instanceof MigratingActor && globalId == null)
this.globalId = MigrationService.registerMigratingActor();
result = doRun();
die(null);
return result;
} catch (ActorAbort abort) {
throw abort;
} catch (InterruptedException e) {
if (this.exception != null) {
die(exception);
throw (RuntimeException) exception;
}
die(e);
throw e;
} catch (Throwable t) {
if (t.getCause() instanceof InterruptedException) {
InterruptedException ie = (InterruptedException) t.getCause();
if (this.exception != null) {
die(exception);
throw (RuntimeException) exception;
}
die(ie);
throw ie;
}
this.exception = t;
die(t);
throw t;
} finally {
record(1, "Actor", "die", "Actor %s is now dead of %s", this, getDeathCause());
if (!strand.isFiber())
currentActor.set(null);
JMXActorsMonitor.getInstance().actorTerminated(ref, strand);
}
}