本文整理了Java中akka.actor.Props.<init>()
方法的一些代码示例,展示了Props.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Props.<init>()
方法的具体详情如下:
包路径:akka.actor.Props
类名称:Props
方法名:<init>
暂无
代码示例来源:origin: stackoverflow.com
ActorRef myActor = Akka.system().actorOf(new Props(MyGeneratorMaster.class));
代码示例来源:origin: stackoverflow.com
ActorRef child = this.getContext().actorOf(new Props(MyGeneratorChildWorker.class));
代码示例来源:origin: write2munish/Akka-Essentials
public static void main(String[] args) throws Exception {
ActorSystem _system = ActorSystem.create("FutureUsageExample");
ActorRef processOrder = _system.actorOf(new Props(
ProcessOrderActor.class));
processOrder.tell(Integer.valueOf(456));
Thread.sleep(5000);
_system.shutdown();
}
代码示例来源:origin: write2munish/Akka-Essentials
public static void main(String[] args) throws Exception {
ActorSystem _system = ActorSystem.create("BecomeUnbecome");
ActorRef pingPongActor = _system
.actorOf(new Props(PingPongActor.class));
pingPongActor.tell(PingPongActor.PING, pingPongActor);
Thread.sleep(2000);
_system.shutdown();
}
代码示例来源:origin: stackoverflow.com
final ActorSystem actorSystem = ActorSystem.create("ServerEvents");
final ActorRef actor = actorSystem.actorOf(new Props(SeverEventHandler.class));
actorSystem.eventStream().subscribe(actor,ServerMessage.class);
actorSystem.eventStream().publish(new ServerMessage()); <<== add this
代码示例来源:origin: stackoverflow.com
public class MyParent extends UntypedActor {
final Props workerProps;
public MyParent() {
workerProps = new Props(...);
}
public MyParent(Props p) {
workerProps = p;
}
...
getContext().actorOf(workerProps, "worker");
}
代码示例来源:origin: stackoverflow.com
if (masterInventory[iterator] instanceof Collectible) {
itemToReturn = new Collectible((Collectible) masterInventory[iterator]);
}
if (masterInventory[iterator] instanceof Props) {
itemToReturn = new Props((Props) masterInventory[iterator]);
}
代码示例来源:origin: stackoverflow.com
ActorRef myActor = system.actorOf(new Props(new UntypedActorFactory() {
public UntypedActor create() {
return new MyActor("...");
}
}), "myactor");
代码示例来源:origin: org.restcomm/restcomm-connect.http
private ActorRef tts(final Configuration configuration) {
final String classpath = configuration.getString("[@class]");
final Props props = new Props(new UntypedActorFactory() {
private static final long serialVersionUID = 1L;
@Override
public Actor create() throws Exception {
return (UntypedActor) Class.forName(classpath).getConstructor(Configuration.class).newInstance(configuration);
}
});
return system.actorOf(props);
}
代码示例来源:origin: org.restcomm/restcomm-connect.http
private ActorRef session(final Configuration configuration) {
final Props props = new Props(new UntypedActorFactory() {
private static final long serialVersionUID = 1L;
@Override
public Actor create() throws Exception {
return new EmailService(configuration);
}
});
return system.actorOf(props);
}
代码示例来源:origin: org.restcomm/restcomm-connect.http
private ActorRef observer() {
final Props props = new Props(new UntypedActorFactory() {
private static final long serialVersionUID = 1L;
@Override
public UntypedActor create() throws Exception {
return new EmailSessionObserver();
}
});
return system.actorOf(props);
}
代码示例来源:origin: org.restcomm/restcomm-connect.http
private ActorRef cache(final String path, final String uri) {
final Props props = new Props(new UntypedActorFactory() {
private static final long serialVersionUID = 1L;
@Override
public Actor create() throws Exception {
return new DiskCacheFactory(configuration).getDiskCache(path, uri);
}
});
return system.actorOf(props);
}
代码示例来源:origin: org.restcomm/restcomm-connect.http
private ActorRef observer() {
final Props props = new Props(new UntypedActorFactory() {
private static final long serialVersionUID = 1L;
@Override
public UntypedActor create() throws Exception {
return new SmsSessionObserver();
}
});
return system.actorOf(props);
}
代码示例来源:origin: org.restcomm/restcomm-connect.data.recorder
@Override
public ActorRef getUSSDDataRecorder() {
return system.actorOf(new Props(this.ussdDataRecorderFactory));
}
代码示例来源:origin: henrikengstrom/akka-kata-java
public static void main(String[] args) {
ActorSystem system = ActorSystem.create("BettingProcessorActorSystem", ConfigFactory.load());
ActorRef bettingProcessor = system.actorOf(new Props(BettingProcessor.class), "bettingProcessor");
}
}
代码示例来源:origin: henrikengstrom/akka-kata-java
public static void main(String[] args) {
ActorSystem system = ActorSystem.create("BettingServiceActorSystem", ConfigFactory.load());
system.actorOf(new Props(BettingService.class), "bettingService");
}
}
代码示例来源:origin: org.restcomm/restcomm-connect.mrb
private ActorRef gateway() {
final Props props = new Props(new UntypedActorFactory() {
private static final long serialVersionUID = 1L;
@Override
public UntypedActor create() throws Exception {
final String classpath = configuration.getString("mgcp-server[@class]");
return (UntypedActor) new ObjectFactory(loader).getObjectInstance(classpath);
}
});
return getContext().actorOf(props);
}
代码示例来源:origin: org.restcomm/restcomm-connect.http
private ActorRef httpAsycClientHelper(){
final Props props = new Props(new UntypedActorFactory() {
private static final long serialVersionUID = 1L;
@Override
public UntypedActor create() throws Exception {
return new HttpAsycClientHelper();
}
});
return getContext().actorOf(props);
}
代码示例来源:origin: org.restcomm/restcomm-connect.mrb
protected ActorRef createMediaGroup(final Object message) {
final Props props = new Props(new UntypedActorFactory() {
protected static final long serialVersionUID = 1L;
@Override
public UntypedActor create() throws Exception {
return new MgcpMediaGroup(localMediaGateway, localMediaSession, localConfernceEndpoint);
}
});
return getContext().actorOf(props);
}
代码示例来源:origin: org.restcomm/restcomm-connect.mgcp
private ActorRef getConnection(final Object message) {
final CreateConnection request = (CreateConnection) message;
final MediaSession session = request.session();
final ActorRef gateway = self();
final Props props = new Props(new UntypedActorFactory() {
private static final long serialVersionUID = 1L;
@Override
public UntypedActor create() throws Exception {
return new Connection(gateway, session, agent, timeout);
}
});
return getContext().actorOf(props);
}
内容来源于网络,如有侵权,请联系作者删除!