Мой тестовый код выглядит примерно так
Код: Выделить всё
try {
destination = new ContainerID("Main-Container", null);
} catch (Exception e) {
System.err.println("Migration failed: " + e.getMessage());
}
b = new Behaviour() {
private boolean stop = false;
@Override
public void action() {
doMove(destination);
block();
System.out.println("Shouldn't print");
stop = true;
}
@Override
public boolean done() {
return stop;
}
};
addBehaviour(b);
}
// Executed upon arrival at a container as a result of migration
protected void afterMove() {
Location origen = here();
System.out.println("HEY, i migrated succesfully");
b.restart();
}
В нем говорится, что поведение перезапускается, но не означает ли это, что метод действия выполняется снова? Или слово «перезапуск» используется как синоним слова «возобновление»
Подробнее здесь: https://stackoverflow.com/questions/798 ... aviour-and
Мобильная версия