【发布时间】:2015-12-01 10:29:35
【问题描述】:
是否可以在 UntypedActor 中注入控制器类? 连接到控制器类的最佳方式是什么?
package actors;
import akka.actor.UntypedActor;
import dispatchers.PushNotificationDispatcher;
import play.Logger;
import javax.inject.Inject;
import java.util.List;
public class PushNotificationActor extends UntypedActor {
@Inject
PushNotificationDispatcher dispatcher;
@Override
public void onReceive(Object message) throws Exception {
Logger.debug("PushNotificationActor started");
dispatcher.createAndSendReminderPushNotification();
Logger.debug("PushNotificationActor finished");
}
}
【问题讨论】:
标签: playframework playframework-2.0 playframework-2.4