Wrap long lines, for pdf
This commit is contained in:
parent
7c1ab68263
commit
95366cb585
27 changed files with 108 additions and 67 deletions
|
|
@ -161,7 +161,8 @@ public class UntypedActorDocTest {
|
|||
//#system-actorOf
|
||||
// ActorSystem is a heavy object: create only one per application
|
||||
final ActorSystem system = ActorSystem.create("MySystem");
|
||||
final ActorRef myActor = system.actorOf(Props.create(MyUntypedActor.class), "myactor");
|
||||
final ActorRef myActor = system.actorOf(Props.create(MyUntypedActor.class),
|
||||
"myactor");
|
||||
//#system-actorOf
|
||||
try {
|
||||
new JavaTestKit(system) {
|
||||
|
|
@ -238,7 +239,8 @@ public class UntypedActorDocTest {
|
|||
//#creating-indirectly
|
||||
|
||||
final ActorRef myActor = getContext().actorOf(
|
||||
Props.create(DependencyInjector.class, applicationContext, "MyActor"), "myactor3");
|
||||
Props.create(DependencyInjector.class, applicationContext, "MyActor"),
|
||||
"myactor3");
|
||||
//#creating-indirectly
|
||||
new JavaTestKit(system) {
|
||||
{
|
||||
|
|
|
|||
|
|
@ -23,8 +23,8 @@ public class MyDurableMessageQueue extends DurableMessageQueueWithSerialization
|
|||
private final QueueStorage storage = new QueueStorage();
|
||||
// A real-world implementation would use configuration to set the last
|
||||
// three parameters below
|
||||
private final CircuitBreaker breaker = CircuitBreaker.create(system().scheduler(), 5,
|
||||
Duration.create(30, "seconds"), Duration.create(1, "minute"));
|
||||
private final CircuitBreaker breaker = CircuitBreaker.create(system().scheduler(),
|
||||
5, Duration.create(30, "seconds"), Duration.create(1, "minute"));
|
||||
|
||||
@Override
|
||||
public void enqueue(ActorRef receiver, final Envelope envelope) {
|
||||
|
|
|
|||
|
|
@ -566,7 +566,8 @@ public class FutureDocTest {
|
|||
return "foo";
|
||||
}
|
||||
}, ec);
|
||||
Future<String> result = Futures.firstCompletedOf(Arrays.<Future<String>>asList(future, delayed), ec);
|
||||
Future<String> result = Futures.firstCompletedOf(
|
||||
Arrays.<Future<String>>asList(future, delayed), ec);
|
||||
//#after
|
||||
Await.result(result, Duration.create(2, SECONDS));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,7 +43,8 @@ public class Processor extends UntypedActor {
|
|||
final PipelineStage<Context, Message, ByteString, Message, ByteString> stages =
|
||||
PipelineStage.sequence(
|
||||
// Java 7 can infer these types, Java 6 cannot
|
||||
PipelineStage.<Context, Message, Message, ByteString, Message, Message, ByteString> sequence( //
|
||||
PipelineStage.<Context, Message, Message, ByteString, Message, Message,
|
||||
ByteString> sequence( //
|
||||
new TickGenerator<Message, Message>(interval), //
|
||||
new MessageStage()), //
|
||||
new LengthFieldFrame(10000));
|
||||
|
|
|
|||
|
|
@ -57,7 +57,8 @@ public class SslDocTest {
|
|||
final LoggingAdapter log = Logging
|
||||
.getLogger(getContext().system(), getSelf());
|
||||
|
||||
public SslClient(InetSocketAddress remote, SSLContext sslContext, ActorRef listener) {
|
||||
public SslClient(InetSocketAddress remote, SSLContext sslContext,
|
||||
ActorRef listener) {
|
||||
this.remote = remote;
|
||||
this.sslContext = sslContext;
|
||||
this.listener = listener;
|
||||
|
|
|
|||
|
|
@ -176,14 +176,17 @@ public class CustomRouterDocTest {
|
|||
//#crRoutingLogic
|
||||
return new CustomRoute() {
|
||||
@Override
|
||||
public scala.collection.immutable.Seq<Destination> destinationsFor(ActorRef sender, Object msg) {
|
||||
public scala.collection.immutable.Seq<Destination> destinationsFor(
|
||||
ActorRef sender, Object msg) {
|
||||
switch ((Message) msg) {
|
||||
case DemocratVote:
|
||||
case DemocratCountResult:
|
||||
return akka.japi.Util.immutableSingletonSeq(new Destination(sender, democratActor));
|
||||
return akka.japi.Util.immutableSingletonSeq(
|
||||
new Destination(sender, democratActor));
|
||||
case RepublicanVote:
|
||||
case RepublicanCountResult:
|
||||
return akka.japi.Util.immutableSingletonSeq(new Destination(sender, republicanActor));
|
||||
return akka.japi.Util.immutableSingletonSeq(
|
||||
new Destination(sender, republicanActor));
|
||||
default:
|
||||
throw new IllegalArgumentException("Unknown message: " + msg);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -64,7 +64,8 @@ public class SerializationDocTest {
|
|||
|
||||
// Deserialize
|
||||
// (beneath fromBinary)
|
||||
final ActorRef deserializedActorRef = extendedSystem.provider().resolveActorRef(identifier);
|
||||
final ActorRef deserializedActorRef = extendedSystem.provider().resolveActorRef(
|
||||
identifier);
|
||||
// Then just use the ActorRef
|
||||
//#actorref-serializer
|
||||
JavaTestKit.shutdownActorSystem(extendedSystem);
|
||||
|
|
|
|||
|
|
@ -88,7 +88,8 @@ public class ZeromqDocTest {
|
|||
|
||||
byte[] payload = new byte[0];
|
||||
//#pub-topic
|
||||
pubSocket.tell(ZMQMessage.withFrames(ByteString.fromString("foo.bar"), ByteString.fromArray(payload)), null);
|
||||
pubSocket.tell(ZMQMessage.withFrames(ByteString.fromString("foo.bar"),
|
||||
ByteString.fromArray(payload)), null);
|
||||
//#pub-topic
|
||||
|
||||
system.stop(subSocket);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue