• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java InvalidActorNameException类的典型用法和代码示例

java 1次浏览

本文整理汇总了Java中akka.actor.InvalidActorNameException的典型用法代码示例。如果您正苦于以下问题:Java InvalidActorNameException类的具体用法?Java InvalidActorNameException怎么用?Java InvalidActorNameException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

InvalidActorNameException类属于akka.actor包,在下文中一共展示了InvalidActorNameException类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: newTestRaftActor

点赞 3

import akka.actor.InvalidActorNameException; //导入依赖的package包/类
protected TestActorRef<TestRaftActor> newTestRaftActor(String id, TestRaftActor.Builder builder) {
    builder.collectorActor(factory.createActor(
            MessageCollectorActor.props(), factory.generateActorId(id + "-collector"))).id(id);

    InvalidActorNameException lastEx = null;
    for (int i = 0; i < 10; i++) {
        try {
            return factory.createTestActor(builder.props().withDispatcher(Dispatchers.DefaultDispatcherId())
                    .withMailbox(Mailboxes.DefaultMailboxId()), id);
        } catch (InvalidActorNameException e) {
            lastEx = e;
            Uninterruptibles.sleepUninterruptibly(100, TimeUnit.MILLISECONDS);
        }
    }

    assertNotNull(lastEx);
    throw lastEx;
}
 

开发者ID:hashsdn,
项目名称:hashsdn-controller,
代码行数:19,
代码来源:AbstractRaftActorIntegrationTest.java

示例2: createTestActor

点赞 3

import akka.actor.InvalidActorNameException; //导入依赖的package包/类
/**
 * Create a test actor with the passed in name.
 *
 * @param props the actor Props
 * @param actorId name of actor
 * @param <T> the actor type
 * @return the ActorRef
 */
@SuppressWarnings("unchecked")
public <T extends Actor> TestActorRef<T> createTestActor(Props props, String actorId) {
    InvalidActorNameException lastError = null;
    for (int i = 0; i < 10; i++) {
        try {
            TestActorRef<T> actorRef = TestActorRef.create(system, props, actorId);
            return (TestActorRef<T>) addActor(actorRef, true);
        } catch (InvalidActorNameException e) {
            lastError = e;
            Uninterruptibles.sleepUninterruptibly(100, TimeUnit.MILLISECONDS);
        }
    }

    throw lastError;
}
 

开发者ID:hashsdn,
项目名称:hashsdn-controller,
代码行数:24,
代码来源:TestActorFactory.java

示例3: forwardToSessionActor

点赞 3

import akka.actor.InvalidActorNameException; //导入依赖的package包/类
private void forwardToSessionActor(SessionAwareMsg msg) {
  if (msg instanceof ToDeviceSessionActorMsg || msg instanceof SessionCloseMsg) {
    String sessionIdStr = msg.getSessionId().toUidStr();
    ActorRef sessionActor = sessionActors.get(sessionIdStr);
    if (sessionActor != null) {
      sessionActor.tell(msg, ActorRef.noSender());
    } else {
      log.debug("[{}] Session actor was already removed.", sessionIdStr);
    }
  } else {
    try {
      getOrCreateSessionActor(msg.getSessionId()).tell(msg, self());
    } catch (InvalidActorNameException e) {
      log.info("Invalid msg : {}", msg);
    }
  }
}
 

开发者ID:osswangxining,
项目名称:iotplatform,
代码行数:18,
代码来源:SessionManagerActor.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)