本文整理匯總了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);
}