當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。