Package akkazeromq

Source Code of akkazeromq.SubscriberMain$Logger

package akkazeromq;

import static akka.actor.Actors.actorOf;
import static akkazeromq.Subscriber.Receive;
import akka.actor.ActorRef;
import akka.actor.UntypedActor;
import akka.actor.UntypedActorFactory;

public class SubscriberMain {
  public static void main(String[] args) {
    final ActorRef logger = actorOf(Logger.class).start();
    ActorRef subscriber = actorOf(new UntypedActorFactory() {
      public UntypedActor create() {
        return new Subscriber("tcp://localhost:5555", new StringFormat(), logger);
      }
    }).start();
    subscriber.sendOneWay(Receive);
  }

  public static class Logger extends UntypedActor {
    @Override
    public void onReceive(Object message) throws Exception {
      log().logger().info("Received " + message);
    }
  }
}
TOP

Related Classes of akkazeromq.SubscriberMain$Logger

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.