I am trying to insert OneForOneStrategy into a simple Hello-Akka program, for example, based on this documentation: http://doc.akka.io/docs/akka/2.3.2/java/fault-tolerance.html p>
private static SupervisorStrategy strategy = new OneForOneStrategy(10, Duration.create("1 minute"), new Function<Throwable, SupervisorStrategy.Directive>() { @Override public SupervisorStrategy.Directive apply(Throwable t) { if (t instanceof ArithmeticException) { return resume(); } else if (t instanceof NullPointerException) { return restart(); } else if (t instanceof IllegalArgumentException) { return stop(); } else { return escalate(); } } } ); @Override public SupervisorStrategy supervisorStrategy() { return strategy; }
However, calls to resume / restart / stop / escalate do not compile out of the box. Why not?
source share