use of akka.actor.BootstrapSetup in project flink by apache.
the class RobustActorSystem method create.
private static RobustActorSystem create(String name, ActorSystemSetup setup, Option<Thread.UncaughtExceptionHandler> uncaughtExceptionHandler) {
final Optional<BootstrapSetup> bootstrapSettings = setup.get(BootstrapSetup.class);
final ClassLoader classLoader = RobustActorSystem.class.getClassLoader();
final Config appConfig = bootstrapSettings.map(BootstrapSetup::config).flatMap(RobustActorSystem::toJavaOptional).orElseGet(() -> ConfigFactory.load(classLoader));
final Option<ExecutionContext> defaultEC = toScalaOption(bootstrapSettings.map(BootstrapSetup::defaultExecutionContext).flatMap(RobustActorSystem::toJavaOptional));
final RobustActorSystem robustActorSystem = new RobustActorSystem(name, appConfig, classLoader, defaultEC, setup) {
@Override
public Thread.UncaughtExceptionHandler uncaughtExceptionHandler() {
return uncaughtExceptionHandler.getOrElse(super::uncaughtExceptionHandler);
}
};
robustActorSystem.start();
return robustActorSystem;
}
Aggregations