Consider this,
class PageActor extends UntypedActor {
private Page page;
private ActorRef documentActor;
public PDFPageActor(ActorRef pdfDocumentActor) {
super();
pdfPage = new PDFPage();
this.pdfDocumentActor = pdfDocumentActor;
}
@Override
public void onReceive(Object message) throws Exception {
// handle the message;
}
public void doProcess() {
statement;
statement;
send a request to **Document actor**(requesting a object);
statement(make use of the above object);
statement;
send a request to **Document actor**(requesting a object);
statement(make use of above object);
statement;
statement(make use of both the objects)
}
}
class PageActor extends Untype