akka.actor.SupervisorStrategy.Directive Java Examples
The following examples show how to use
akka.actor.SupervisorStrategy.Directive.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SetupDocumentTypeWorkerActor.java From searchanalytics-bigdata with MIT License | 6 votes |
@Override public Directive apply(final Throwable t) { if (t instanceof DocumentTypeDataGenerationException) { return restart(); } else if (t instanceof DocumentGenerationException) { return restart(); } else if (t instanceof IndexDataException) { return restart(); } else if (t instanceof ActorInitializationException) { return stop(); } else if (t instanceof ActorKilledException) { return stop(); } else if (t instanceof Exception) { return restart(); } else { return escalate(); } }
Example #2
Source File: AppActor.java From iotplatform with Apache License 2.0 | 5 votes |
@Override public Directive apply(Throwable t) { logger.error(t, "Unknown failure"); if (t instanceof RuntimeException) { return SupervisorStrategy.restart(); } else { return SupervisorStrategy.stop(); } }