Package akka.actor

Examples of akka.actor.ActorSystem.actorOf()


      withFallback(ConfigFactory.parseString("akka.cluster.roles = [frontend]")).
      withFallback(ConfigFactory.load());

    ActorSystem system = ActorSystem.create("ClusterSystem", config);

    final ActorRef frontend = system.actorOf(
        Props.create(TransformationFrontend.class), "frontend");
    final FiniteDuration interval = Duration.create(2, TimeUnit.SECONDS);
    final Timeout timeout = new Timeout(Duration.create(5, TimeUnit.SECONDS));
    final ExecutionContext ec = system.dispatcher();
    final AtomicInteger counter = new AtomicInteger();
View Full Code Here


      withFallback(ConfigFactory.parseString("akka.cluster.roles = [backend]")).
      withFallback(ConfigFactory.load());

    ActorSystem system = ActorSystem.create("ClusterSystem", config);

    system.actorOf(Props.create(TransformationBackend.class), "backend");

  }

}
View Full Code Here

          .withFallback(ConfigFactory.load("stats2"));

      ActorSystem system = ActorSystem.create("ClusterSystem", config);

      //#create-singleton-manager
      system.actorOf(ClusterSingletonManager.defaultProps(
          Props.create(StatsService.class), "statsService",
          PoisonPill.getInstance(), "compute"), "singleton");
      //#create-singleton-manager

      //#singleton-proxy
View Full Code Here

          Props.create(StatsService.class), "statsService",
          PoisonPill.getInstance(), "compute"), "singleton");
      //#create-singleton-manager

      //#singleton-proxy
      system.actorOf(ClusterSingletonProxy.defaultProps("/user/singleton/statsService",
        "compute"), "statsServiceProxy");
      //#singleton-proxy
    }

  }
View Full Code Here

  public static void main(String[] args) {
    // note that client is not a compute node, role not defined
    ActorSystem system = ActorSystem.create("ClusterSystem",
        ConfigFactory.load("stats1"));
    system.actorOf(Props.create(StatsSampleClient.class, "/user/statsService"),
        "client");
  }
}
View Full Code Here

              ConfigFactory.parseString("akka.cluster.roles = [compute]"))
          .withFallback(ConfigFactory.load("stats1"));

      ActorSystem system = ActorSystem.create("ClusterSystem", config);

      system.actorOf(Props.create(StatsWorker.class), "statsWorker");
      system.actorOf(Props.create(StatsService.class), "statsService");
    }

  }
}
View Full Code Here

          .withFallback(ConfigFactory.load("stats1"));

      ActorSystem system = ActorSystem.create("ClusterSystem", config);

      system.actorOf(Props.create(StatsWorker.class), "statsWorker");
      system.actorOf(Props.create(StatsService.class), "statsService");
    }

  }
}
View Full Code Here

  public static void main(String[] args) {
    // note that client is not a compute node, role not defined
    ActorSystem system = ActorSystem.create("ClusterSystem",
        ConfigFactory.load("stats2"));
    system.actorOf(Props.create(StatsSampleClient.class, "/user/statsServiceProxy"),
        "client");

  }

}
View Full Code Here

      // Create an Akka system
      ActorSystem system = ActorSystem.create("ClusterSystem", config);

      // Create an actor that handles cluster domain events
      system.actorOf(Props.create(SimpleClusterListener.class),
          "clusterListener");

    }
  }
}
View Full Code Here

    @Test
    public void mustSupportMdcNull() throws Exception {
        final ActorSystem system = ActorSystem.create("test-system", config);
        new LogJavaTestKit(system) {{
            system.eventStream().subscribe(getRef(), LogEvent.class);
            ActorRef ref = system.actorOf(Props.create(ActorWithMDC.class));

            ref.tell(new Log(InfoLevel(), "Null MDC"), system.deadLetters());
            expectLog(InfoLevel(), "Null MDC", "Map()");
        }};
    }
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.