#2746 - document provider.getDefaultAddress

This commit is contained in:
Roland 2012-11-28 14:56:53 +01:00
parent 370eeb00a4
commit cda2c2b62a
4 changed files with 6 additions and 40 deletions

View file

@ -138,12 +138,7 @@ public class SerializationDocTestBase {
}
public Address getAddress() {
final ActorRefProvider provider = system.provider();
if (provider instanceof RemoteActorRefProvider) {
return ((RemoteActorRefProvider) provider).transport().address();
} else {
throw new UnsupportedOperationException("need RemoteActorRefProvider");
}
return system.provider().getDefaultAddress();
}
}

View file

@ -149,16 +149,12 @@ concrete address handy you can create a dummy one for the right protocol using
``new Address(protocol, "", "", 0)`` (assuming that the actual transport used is as
lenient as Akkas RemoteActorRefProvider).
There is a possible simplification available if you are just using the default
:class:`NettyRemoteTransport` with the :meth:`RemoteActorRefProvider`, which is
enabled by the fact that this combination has just a single remote address:
There is also a default remote address which is the one used by cluster support
(and typical systems have just this one); you can get it like this:
.. includecode:: code/docs/serialization/SerializationDocTestBase.java
:include: external-address-default
This solution has to be adapted once other providers are used (like the planned
extensions for clustering).
Deep serialization of Actors
----------------------------