本文整理汇总了Java中akka.actor.OneForOneStrategy.escalate方法的典型用法代码示例。如果您正苦于以下问题:Java OneForOneStrategy.escalate方法的具体用法?Java OneForOneStrategy.escalate怎么用?Java OneForOneStrategy.escalate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类akka.actor.OneForOneStrategy
的用法示例。
在下文中一共展示了OneForOneStrategy.escalate方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buildResumeOnRuntimeErrorStrategy
import akka.actor.OneForOneStrategy; //导入方法依赖的package包/类
private static SupervisorStrategy buildResumeOnRuntimeErrorStrategy() {
return new OneForOneStrategy(-1, Duration.Inf(),
new Function<Throwable, SupervisorStrategy.Directive>() {
@Override
public Directive apply(Throwable throwable) throws Exception {
logException(throwable);
if (throwable instanceof Error) {
return OneForOneStrategy.escalate();
} else if (throwable instanceof RuntimeException) {
return OneForOneStrategy.resume();
} else {
return OneForOneStrategy.restart();
}
}
});
}
示例2: supervisorStrategy
import akka.actor.OneForOneStrategy; //导入方法依赖的package包/类
@Override
public SupervisorStrategy supervisorStrategy() {
return new OneForOneStrategy(-1, Duration.Inf(), throwable -> {
logger.error(throwable, "Unknown session error");
if (throwable instanceof Error) {
return OneForOneStrategy.escalate();
} else {
return OneForOneStrategy.resume();
}
});
}
示例3: supervisorStrategy
import akka.actor.OneForOneStrategy; //导入方法依赖的package包/类
@Override
public SupervisorStrategy supervisorStrategy() {
return new OneForOneStrategy(-1, Duration.Inf(),
throwable -> {
logger.error(throwable, "Unknown session error");
if (throwable instanceof Error) {
return OneForOneStrategy.escalate();
} else {
return OneForOneStrategy.resume();
}
});
}
示例4: buildResumeOrEscalateStrategy
import akka.actor.OneForOneStrategy; //导入方法依赖的package包/类
private static SupervisorStrategy buildResumeOrEscalateStrategy() {
return new OneForOneStrategy(-1, Duration.Inf(),
new Function<Throwable, SupervisorStrategy.Directive>() {
@Override
public Directive apply(Throwable throwable) throws Exception {
logException(throwable);
if (throwable instanceof Error) {
return OneForOneStrategy.escalate();
} else {
return OneForOneStrategy.resume();
}
}
});
}
示例5: buildRestartOrEscalateStrategy
import akka.actor.OneForOneStrategy; //导入方法依赖的package包/类
private static SupervisorStrategy buildRestartOrEscalateStrategy() {
return new OneForOneStrategy(-1, Duration.Inf(),
new Function<Throwable, SupervisorStrategy.Directive>() {
@Override
public Directive apply(Throwable throwable) throws Exception {
logException(throwable);
if (throwable instanceof Error) {
return OneForOneStrategy.escalate();
} else {
return OneForOneStrategy.restart();
}
}
});
}
示例6: apply
import akka.actor.OneForOneStrategy; //导入方法依赖的package包/类
@Override
public Directive apply(Throwable t) throws Exception {
if(t instanceof ActorInitializationException) {
return OneForOneStrategy.stop();
} else if(t instanceof Exception) {
return OneForOneStrategy.restart();
}
return OneForOneStrategy.escalate();
}