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


Java ActorRef.forward方法代码示例

本文整理汇总了Java中akka.actor.ActorRef.forward方法的典型用法代码示例。如果您正苦于以下问题:Java ActorRef.forward方法的具体用法?Java ActorRef.forward怎么用?Java ActorRef.forward使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在akka.actor.ActorRef的用法示例。


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

示例1: onOnline

import akka.actor.ActorRef; //导入方法依赖的package包/类
@Override
public void onOnline(MemberOnlineEvent onlineEvent) {
    ActorRef roomContext = selectRoomContext(onlineEvent.getLoginUserId());
    if (roomContext == null) {
        getLogger().info("User id {} not instance RoomContext.", onlineEvent.getLoginUserId());
        return;
    }
    roomContext.forward(onlineEvent, getContext());
}
 
开发者ID:freedompy,项目名称:commelina,代码行数:10,代码来源:RoomBackend.java

示例2: onOffline

import akka.actor.ActorRef; //导入方法依赖的package包/类
@Override
public void onOffline(MemberOfflineEvent offlineEvent) {
    ActorRef roomContext = selectRoomContext(offlineEvent.getLogoutUserId());
    if (roomContext == null) {
        getLogger().info("User id {} not instance RoomContext.", offlineEvent.getLogoutUserId());
        return;
    }
    roomContext.forward(offlineEvent, getContext());
}
 
开发者ID:freedompy,项目名称:commelina,代码行数:10,代码来源:RoomBackend.java

示例3: execute

import akka.actor.ActorRef; //导入方法依赖的package包/类
@Override
public void execute(final TimeoutScheduleStartMessage message) throws Exception {
  final SubjectState subjectState = subjectStateRepository.findOne(message.getSsId());
  final String id =
      StringUtils.isBlank(message.getTimeoutActorId()) ? getId() : message.getTimeoutActorId();
  subjectState.setTimeoutActor(id);

  final ActorRef timeoutScheduler =
      getParentContext().actorOf(springExtension.props("TimeoutScheduleActor"), id);
  timeoutScheduler.forward(message, getParentContext());
}
 
开发者ID:stefanstaniAIM,项目名称:IPPR2016,代码行数:12,代码来源:StartTimeoutTask.java

示例4: handleUserWakeUpMessage

import akka.actor.ActorRef; //导入方法依赖的package包/类
private void handleUserWakeUpMessage(final Object obj) {
  final UserActorWakeUpMessage.Request msg = (UserActorWakeUpMessage.Request) obj;
  final String userId = getUserId(msg.getUserId());
  final Optional<ActorRef> actorOpt = akkaSelector.findActor(getContext(), userId);

  ActorRef actor = null;
  if (!actorOpt.isPresent()) {
    actor = getContext().actorOf(springExtension.props("UserActor", msg.getUserId()), userId);
  } else {
    actor = actorOpt.get();
  }
  actor.forward(msg, getContext());
}
 
开发者ID:stefanstaniAIM,项目名称:IPPR2016,代码行数:14,代码来源:UserSupervisorActor.java

示例5: executeTask

import akka.actor.ActorRef; //导入方法依赖的package包/类
public void executeTask(final TaskAllocation task, final UntypedActorContext context,
    final Object msg) {
  final ActorRef taskActor =
      context.actorOf(springExtension.props(task.getActorName()), getTaskId());
  taskActor.forward(msg, context);
}
 
开发者ID:stefanstaniAIM,项目名称:IPPR2016,代码行数:7,代码来源:TaskManager.java

示例6: executeTaskInContext

import akka.actor.ActorRef; //导入方法依赖的package包/类
public void executeTaskInContext(final TaskAllocation task, final UntypedActorContext context,
    final Object msg) {
  final ActorRef taskActor =
      context.actorOf(springExtension.props(task.getActorName(), context), getTaskId());
  taskActor.forward(msg, context);
}
 
开发者ID:stefanstaniAIM,项目名称:IPPR2016,代码行数:7,代码来源:TaskManager.java


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