Hide Echo actor impl from docs, see #2537
This commit is contained in:
parent
5a2ebb172d
commit
b21687dbf2
4 changed files with 8 additions and 12 deletions
|
|
@ -21,13 +21,11 @@ import akka.actor.UntypedActor;
|
||||||
|
|
||||||
public class RemoteDeploymentDocTestBase {
|
public class RemoteDeploymentDocTestBase {
|
||||||
|
|
||||||
//#sample-actor
|
public static class SampleActor extends UntypedActor {
|
||||||
public static class Echo extends UntypedActor {
|
|
||||||
public void onReceive(Object message) {
|
public void onReceive(Object message) {
|
||||||
getSender().tell(getSelf(), getSelf());
|
getSender().tell(getSelf(), getSelf());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//#sample-actor
|
|
||||||
|
|
||||||
static ActorSystem system;
|
static ActorSystem system;
|
||||||
|
|
||||||
|
|
@ -48,7 +46,7 @@ public class RemoteDeploymentDocTestBase {
|
||||||
addr = AddressFromURIString.parse("akka://sys@host:1234"); // the same
|
addr = AddressFromURIString.parse("akka://sys@host:1234"); // the same
|
||||||
//#make-address
|
//#make-address
|
||||||
//#deploy
|
//#deploy
|
||||||
ActorRef ref = system.actorOf(new Props(Echo.class).withDeploy(new Deploy(new RemoteScope(addr))));
|
ActorRef ref = system.actorOf(new Props(SampleActor.class).withDeploy(new Deploy(new RemoteScope(addr))));
|
||||||
//#deploy
|
//#deploy
|
||||||
assert ref.path().address().equals(addr);
|
assert ref.path().address().equals(addr);
|
||||||
}
|
}
|
||||||
|
|
@ -57,7 +55,7 @@ public class RemoteDeploymentDocTestBase {
|
||||||
public void demonstrateSampleActor() {
|
public void demonstrateSampleActor() {
|
||||||
//#sample-actor
|
//#sample-actor
|
||||||
|
|
||||||
ActorRef actor = system.actorOf(new Props(Echo.class), "sampleActor");
|
ActorRef actor = system.actorOf(new Props(SampleActor.class), "sampleActor");
|
||||||
actor.tell("Pretty slick", null);
|
actor.tell("Pretty slick", null);
|
||||||
//#sample-actor
|
//#sample-actor
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -104,7 +104,7 @@ Once you have configured the properties above you would do the following in code
|
||||||
|
|
||||||
.. includecode:: code/docs/remoting/RemoteDeploymentDocTestBase.java#sample-actor
|
.. includecode:: code/docs/remoting/RemoteDeploymentDocTestBase.java#sample-actor
|
||||||
|
|
||||||
The actor class ``Echo`` has to be available to the runtimes using it, i.e. the classloader of the
|
The actor class ``SampleActor`` has to be available to the runtimes using it, i.e. the classloader of the
|
||||||
actor systems has to have a JAR containing the class.
|
actor systems has to have a JAR containing the class.
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
|
||||||
|
|
@ -12,11 +12,9 @@ import akka.remote.RemoteScope
|
||||||
|
|
||||||
object RemoteDeploymentDocSpec {
|
object RemoteDeploymentDocSpec {
|
||||||
|
|
||||||
//#sample-actor
|
class SampleActor extends Actor {
|
||||||
class Echo extends Actor {
|
|
||||||
def receive = { case _ ⇒ sender ! self }
|
def receive = { case _ ⇒ sender ! self }
|
||||||
}
|
}
|
||||||
//#sample-actor
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -34,7 +32,7 @@ class RemoteDeploymentDocSpec extends AkkaSpec("""
|
||||||
|
|
||||||
"demonstrate programmatic deployment" in {
|
"demonstrate programmatic deployment" in {
|
||||||
//#deploy
|
//#deploy
|
||||||
val ref = system.actorOf(Props[Echo].withDeploy(Deploy(scope = RemoteScope(address))))
|
val ref = system.actorOf(Props[SampleActor].withDeploy(Deploy(scope = RemoteScope(address))))
|
||||||
//#deploy
|
//#deploy
|
||||||
ref.path.address must be(address)
|
ref.path.address must be(address)
|
||||||
ref ! "test"
|
ref ! "test"
|
||||||
|
|
@ -52,7 +50,7 @@ class RemoteDeploymentDocSpec extends AkkaSpec("""
|
||||||
"demonstrate sampleActor" in {
|
"demonstrate sampleActor" in {
|
||||||
//#sample-actor
|
//#sample-actor
|
||||||
|
|
||||||
val actor = system.actorOf(Props[Echo], "sampleActor")
|
val actor = system.actorOf(Props[SampleActor], "sampleActor")
|
||||||
actor ! "Pretty slick"
|
actor ! "Pretty slick"
|
||||||
//#sample-actor
|
//#sample-actor
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -111,7 +111,7 @@ Once you have configured the properties above you would do the following in code
|
||||||
|
|
||||||
.. includecode:: code/docs/remoting/RemoteDeploymentDocSpec.scala#sample-actor
|
.. includecode:: code/docs/remoting/RemoteDeploymentDocSpec.scala#sample-actor
|
||||||
|
|
||||||
The actor class ``Echo`` has to be available to the runtimes using it, i.e. the classloader of the
|
The actor class ``SampleActor`` has to be available to the runtimes using it, i.e. the classloader of the
|
||||||
actor systems has to have a JAR containing the class.
|
actor systems has to have a JAR containing the class.
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue