本文整理汇总了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());
}
示例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());
}
示例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());
}
示例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());
}
示例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);
}
示例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);
}