Examples of actorOf()


Examples of akka.actor.ActorSystem.actorOf()

    LoggingAdapter log = Logging.getLogger(system, system);

    Integer originalValue = Integer.valueOf(0);

    ActorRef supervisor = system.actorOf(new Props(SupervisorActor.class),
        "supervisor");

    log.info("Sending value 8, no exceptions should be thrown! ");
    supervisor.tell(Integer.valueOf(8));
View Full Code Here

Examples of akka.actor.ActorSystem.actorOf()

   * @throws InterruptedException
   */
  public static void main(String[] args) throws InterruptedException {
    ActorSystem _system = ActorSystem.create("CustomRouteeRouterExample");
   
    ActorRef echoActor1 = _system.actorOf(new Props(MsgEchoActor.class));
    ActorRef echoActor2 = _system.actorOf(new Props(MsgEchoActor.class));
    ActorRef echoActor3 = _system.actorOf(new Props(MsgEchoActor.class));
   
    Iterable<ActorRef> routees = Arrays.asList(new ActorRef[] { echoActor1,
        echoActor2, echoActor3 });
View Full Code Here

Examples of akka.actor.ActorSystem.actorOf()

   */
  public static void main(String[] args) throws InterruptedException {
    ActorSystem _system = ActorSystem.create("CustomRouteeRouterExample");
   
    ActorRef echoActor1 = _system.actorOf(new Props(MsgEchoActor.class));
    ActorRef echoActor2 = _system.actorOf(new Props(MsgEchoActor.class));
    ActorRef echoActor3 = _system.actorOf(new Props(MsgEchoActor.class));
   
    Iterable<ActorRef> routees = Arrays.asList(new ActorRef[] { echoActor1,
        echoActor2, echoActor3 });

View Full Code Here

Examples of akka.actor.ActorSystem.actorOf()

  public static void main(String[] args) throws InterruptedException {
    ActorSystem _system = ActorSystem.create("CustomRouteeRouterExample");
   
    ActorRef echoActor1 = _system.actorOf(new Props(MsgEchoActor.class));
    ActorRef echoActor2 = _system.actorOf(new Props(MsgEchoActor.class));
    ActorRef echoActor3 = _system.actorOf(new Props(MsgEchoActor.class));
   
    Iterable<ActorRef> routees = Arrays.asList(new ActorRef[] { echoActor1,
        echoActor2, echoActor3 });

    ActorRef randomRouter = _system.actorOf(new Props(MsgEchoActor.class)
View Full Code Here

Examples of akka.actor.ActorSystem.actorOf()

    ActorRef echoActor3 = _system.actorOf(new Props(MsgEchoActor.class));
   
    Iterable<ActorRef> routees = Arrays.asList(new ActorRef[] { echoActor1,
        echoActor2, echoActor3 });

    ActorRef randomRouter = _system.actorOf(new Props(MsgEchoActor.class)
        .withRouter(RandomRouter.create(routees)));

    for (int i = 1; i <= 10; i++) {
      // sends randomly to actors
      randomRouter.tell(i);
View Full Code Here

Examples of akka.actor.ActorSystem.actorOf()

  /**
   * @param args
   */
  public static void main(String[] args) {
    ActorSystem system = ActorSystem.create("zeromqClientTest");
    system.actorOf(new Props(ClientActor.class)
        .withRouter(new RoundRobinRouter(3)), "client");
  }

}
View Full Code Here

Examples of akka.actor.ActorSystem.actorOf()

  /**
   * @param args
   */
  public static void main(String[] args) {
    ActorSystem system = ActorSystem.create("zeromqServerTest");
    system.actorOf(new Props(ServerActor.class), "server");
  }

}
View Full Code Here

Examples of akka.actor.ActorSystem.actorOf()

    int lowerBound = 2;
    int upperBound = 15;
    DefaultResizer resizer = new DefaultResizer(lowerBound, upperBound);

    ActorRef randomRouter = _system.actorOf(new Props(MsgEchoActor.class)
        .withRouter(new RandomRouter(resizer)));

    for (int i = 1; i <= 10; i++) {
      // sends randomly to actors
      randomRouter.tell(i);
View Full Code Here

Examples of akka.actor.ActorSystem.actorOf()

    ActorRef actor1 = TypedActor.get(_system).getActorRefFor(calculator1);
    ActorRef actor2 = TypedActor.get(_system).getActorRefFor(calculator2);

    Iterable<ActorRef> routees = Arrays.asList(new ActorRef[] { actor1,
        actor2 });
    ActorRef router = _system.actorOf(new Props()
        .withRouter(BroadcastRouter.create(routees)));

    router.tell("Hello there");

    _system.shutdown();
View Full Code Here

Examples of akka.actor.ActorSystem.actorOf()

  /**
   * @param args
   */
  public static void main(String[] args) {
    ActorSystem _system = ActorSystem.create("CustomRouterExample");
    ActorRef burstyMessageRouter = _system.actorOf(new Props(
        MsgEchoActor.class).withRouter(new BurstyMessageRouter(5,2)));

    for (int i = 1; i <= 13; i++) {
      //sends series of messages in a round robin way to all the actors
      burstyMessageRouter.tell(i);
View Full Code Here
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.