Use Props factory methods in getting started tutorial (#25713)

* Use Props factory methods in getting started tutorial

* deprecate Props.create without actorClass parameter, #25718
This commit is contained in:
Patrik Nordwall 2018-10-15 18:12:41 +02:00 committed by Christopher Batey
parent 4b012cc306
commit b89a7e5df5
17 changed files with 77 additions and 34 deletions

View file

@ -29,7 +29,7 @@ public class Device extends AbstractActor {
}
public static Props props(String groupId, String deviceId) {
return Props.create(Device.class, groupId, deviceId);
return Props.create(Device.class, () -> new Device(groupId, deviceId));
}
public static final class RecordTemperature {

View file

@ -31,7 +31,7 @@ public class DeviceGroup extends AbstractActor {
}
public static Props props(String groupId) {
return Props.create(DeviceGroup.class, groupId);
return Props.create(DeviceGroup.class, () -> new DeviceGroup(groupId));
}
//#device-group-register
//#device-group-remove

View file

@ -19,7 +19,7 @@ public class DeviceManager extends AbstractActor {
private final LoggingAdapter log = Logging.getLogger(getContext().getSystem(), this);
public static Props props() {
return Props.create(DeviceManager.class);
return Props.create(DeviceManager.class, DeviceManager::new);
}
//#device-manager-msgs