How can I create an actor with a custom constructor in java? I looked through the documentation but did not find it.
Here is my actor:
public class ResizePhotoActor extends UntypedActor { private int width; private int height; private String caption; public ResizePhotoActor(int width, int height, String caption) { this.height = height; this.width = width; this.caption = caption; } public void onReceive(Object message) throws Exception { } }
I tried this:
ActorRef imageActorRef = system.actorOf( Props.create(new ResizePhotoActor(1, 2, "")));
But that will not work.
thanks
source share