Formatting java codes with sbt-java-formatter.

This commit is contained in:
hepin1989 2019-01-12 04:00:53 +08:00
parent 27500001ea
commit 998c5a9285
401 changed files with 19750 additions and 17450 deletions

View file

@ -11,14 +11,15 @@ import akka.actor.Terminated;
import akka.actor.AbstractActor;
public class Watcher extends AbstractActor {
static public class Watch {
public static class Watch {
final ActorRef target;
public Watch(ActorRef target) {
this.target = target;
}
}
final CountDownLatch latch;
public Watcher(CountDownLatch latch) {
@ -28,14 +29,17 @@ public class Watcher extends AbstractActor {
@Override
public Receive createReceive() {
return receiveBuilder()
.match(Watch.class, msg -> {
getContext().watch(msg.target);
})
.match(Terminated.class, msg -> {
latch.countDown();
if (latch.getCount() == 0) getContext().stop(getSelf());
})
.build();
.match(
Watch.class,
msg -> {
getContext().watch(msg.target);
})
.match(
Terminated.class,
msg -> {
latch.countDown();
if (latch.getCount() == 0) getContext().stop(getSelf());
})
.build();
}
}