Package akka.actor

Examples of akka.actor.ActorSystem.actorOf()


public class MyActorSystem {

  public static void main(String[] args) throws Exception {

    ActorSystem _system = ActorSystem.create("BecomeUnbecome");
    ActorRef pingPongActor = _system
        .actorOf(new Props(PingPongActor.class));

    pingPongActor.tell(PingPongActor.PING, pingPongActor);

    Thread.sleep(2000);
View Full Code Here


*/
public class LocalNodeApplication {
  public static void main(String[] args) throws Exception {
    ActorSystem _system = ActorSystem.create("LocalNodeApp",ConfigFactory
        .load().getConfig("LocalSys"));
    ActorRef localActor = _system.actorOf(new Props(LocalActor.class));
    localActor.tell("Hello");

    Thread.sleep(5000);
    _system.shutdown();
  }
View Full Code Here

  public TestApp() {

    ActorSystem _system = ActorSystem.create("Extension-Test",
        ConfigFactory.load().getConfig("TestApp"));

    ActorRef ref = _system.actorOf(new Props(MyActor.class));
   
    ref.tell("msg");

    MySQLJDBCSettingsImpl mysqlSetting = MySQLJDBCSettings.SettingsProvider
        .get(_system);
View Full Code Here

   */
  public static void main(String[] args) {
    ActorSystem _system = ActorSystem.create("callingThread-dispatcher",
        ConfigFactory.load().getConfig("MyDispatcherExample"));
   
    ActorRef actor = _system.actorOf(new Props(MsgEchoActor.class)
        .withDispatcher("CallingThreadDispatcher").withRouter(
            new RoundRobinRouter(2)));

    for (int i = 0; i < 5; i++) {
      actor.tell(i);
View Full Code Here

   */
  public static void main(String[] args) {
    ActorSystem _system = ActorSystem.create("pinned-dispatcher",
        ConfigFactory.load().getConfig("MyDispatcherExample"));
   
    ActorRef actor = _system.actorOf(new Props(MsgEchoActor.class)
        .withDispatcher("pinnedDispatcher").withRouter(
            new RoundRobinRouter(5)));

    for (int i = 0; i < 25; i++) {
      actor.tell(i);
View Full Code Here

   */
  public static void main(String[] args) {
    ActorSystem _system = ActorSystem.create("default-dispatcher",
        ConfigFactory.load().getConfig("MyDispatcherExample"));
   
    ActorRef actor = _system.actorOf(new Props(MsgEchoActor.class)
        .withDispatcher("defaultDispatcher1").withRouter(
            new RoundRobinRouter(5)));

    for (int i = 0; i < 25; i++) {
      actor.tell(i);
View Full Code Here

   */
  public static void main(String[] args) {
    ActorSystem _system = ActorSystem.create("balancing-dispatcher",
        ConfigFactory.load().getConfig("MyDispatcherExample"));
   
    ActorRef actor = _system.actorOf(new Props(MsgEchoActor.class)
        .withDispatcher("balancingDispatcher1").withRouter(
            new RoundRobinRouter(5)));

    for (int i = 0; i < 25; i++) {
      actor.tell(i);
View Full Code Here

public class Example1 {
  public static void main(String[] args) {
    ActorSystem _system = ActorSystem.create("default-dispatcher",
        ConfigFactory.load().getConfig("MyDispatcherExample"));
   
    ActorRef actor = _system.actorOf(new Props(MsgEchoActor.class)
        .withDispatcher("defaultDispatcher").withRouter(
            new RoundRobinRouter(5)));

    for (int i = 0; i < 25; i++) {
      actor.tell(i);
View Full Code Here

   */
  public static void main(String[] args) {
    ActorSystem _system = ActorSystem.create("balancing-dispatcher",
        ConfigFactory.load().getConfig("MyDispatcherExample"));
   
    ActorRef actor = _system.actorOf(new Props(MsgEchoActor.class)
        .withDispatcher("balancingDispatcher").withRouter(
            new RoundRobinRouter(5)));

    for (int i = 0; i < 25; i++) {
      actor.tell(i);
View Full Code Here

   * @throws InterruptedException
   */
  public static void main(String[] args) throws InterruptedException {
    ActorSystem _system = ActorSystem.create("RandomRouterExample",
        ConfigFactory.load().getConfig("MyRouterExample"));
    ActorRef randomRouter = _system.actorOf(
        new Props(MsgEchoActor.class).withRouter(new FromConfig()),
        "myRandomRouterActor");

    for (int i = 1; i <= 10; i++) {
      // sends randomly to actors
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.