2011-12-19 11:07:59 +01:00
|
|
|
/**
|
2012-01-19 18:21:06 +01:00
|
|
|
* Copyright (C) 2009-2012 Typesafe Inc. <http://www.typesafe.com>
|
2011-12-19 11:07:59 +01:00
|
|
|
*/
|
2012-05-22 11:37:09 +02:00
|
|
|
package docs.remoting;
|
2011-12-15 21:16:19 +01:00
|
|
|
|
|
|
|
|
import akka.actor.ActorRef;
|
|
|
|
|
import akka.actor.UntypedActor;
|
|
|
|
|
|
|
|
|
|
public class RemoteActorExample extends UntypedActor {
|
|
|
|
|
//#localNodeActor
|
|
|
|
|
ActorRef a1 = getContext().actorFor("/serviceA/retrieval");
|
|
|
|
|
//#localNodeActor
|
|
|
|
|
|
|
|
|
|
//#remoteNodeActor
|
2011-12-15 23:47:12 +01:00
|
|
|
ActorRef a2 = getContext().actorFor("akka://app@10.0.0.1:2552/user/serviceA/retrieval");
|
2011-12-15 21:16:19 +01:00
|
|
|
//#remoteNodeActor
|
|
|
|
|
|
|
|
|
|
public void onReceive(Object message) throws Exception {
|
|
|
|
|
// Do something
|
|
|
|
|
}
|
|
|
|
|
}
|