当前位置: 首页>>代码示例>>Java>>正文


Java OneForOneStrategy.escalate方法代码示例

本文整理汇总了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();
        }
      }
    });
}
 
开发者ID:kaaproject,项目名称:kaa,代码行数:17,代码来源:SupervisionStrategyFactory.java

示例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();
    }
  });
}
 
开发者ID:osswangxining,项目名称:iotplatform,代码行数:12,代码来源:SessionActor.java

示例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();
                }
            });
}
 
开发者ID:thingsboard,项目名称:thingsboard,代码行数:13,代码来源:SessionActor.java

示例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();
        }
      }
    });
}
 
开发者ID:kaaproject,项目名称:kaa,代码行数:15,代码来源:SupervisionStrategyFactory.java

示例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();
        }
      }
    });
}
 
开发者ID:kaaproject,项目名称:kaa,代码行数:15,代码来源:SupervisionStrategyFactory.java

示例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();
}
 
开发者ID:IDgis,项目名称:geo-publisher,代码行数:11,代码来源:Boot.java


注:本文中的akka.actor.OneForOneStrategy.escalate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。