Package akka.actor

Examples of akka.actor.ActorRef.tell()


    @Test
    public void accountTest() throws Exception {
        ActorRef bank = _system.actorOf(new Props(BankActor.class));

        bank.tell(new AccountDebit(Float.parseFloat("1000")));
        bank.tell(new AccountCredit(Float.parseFloat("1000")));
        bank.tell(new AccountDebit(Float.parseFloat("1000")));
        bank.tell(new AccountDebit(Float.parseFloat("1000")));
        bank.tell(new AccountDebit(Float.parseFloat("3500")));
        bank.tell(new AccountCredit(Float.parseFloat("2500")));
        bank.tell(new AccountDebit(Float.parseFloat("3500")));
View Full Code Here


    public void accountTest() throws Exception {
        ActorRef bank = _system.actorOf(new Props(BankActor.class));

        bank.tell(new AccountDebit(Float.parseFloat("1000")));
        bank.tell(new AccountCredit(Float.parseFloat("1000")));
        bank.tell(new AccountDebit(Float.parseFloat("1000")));
        bank.tell(new AccountDebit(Float.parseFloat("1000")));
        bank.tell(new AccountDebit(Float.parseFloat("3500")));
        bank.tell(new AccountCredit(Float.parseFloat("2500")));
        bank.tell(new AccountDebit(Float.parseFloat("3500")));
View Full Code Here

        ActorRef bank = _system.actorOf(new Props(BankActor.class));

        bank.tell(new AccountDebit(Float.parseFloat("1000")));
        bank.tell(new AccountCredit(Float.parseFloat("1000")));
        bank.tell(new AccountDebit(Float.parseFloat("1000")));
        bank.tell(new AccountDebit(Float.parseFloat("1000")));
        bank.tell(new AccountDebit(Float.parseFloat("3500")));
        bank.tell(new AccountCredit(Float.parseFloat("2500")));
        bank.tell(new AccountDebit(Float.parseFloat("3500")));

        // sleeping to allow some time for all messages to be processed
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

        bank.tell(new AccountDebit(Float.parseFloat("1000")));
        bank.tell(new AccountCredit(Float.parseFloat("1000")));
        bank.tell(new AccountDebit(Float.parseFloat("1000")));
        bank.tell(new AccountDebit(Float.parseFloat("1000")));
        bank.tell(new AccountDebit(Float.parseFloat("3500")));
        bank.tell(new AccountCredit(Float.parseFloat("2500")));
        bank.tell(new AccountDebit(Float.parseFloat("3500")));

        // sleeping to allow some time for all messages to be processed
        Thread.sleep(4000);
View Full Code Here

        bank.tell(new AccountDebit(Float.parseFloat("1000")));
        bank.tell(new AccountCredit(Float.parseFloat("1000")));
        bank.tell(new AccountDebit(Float.parseFloat("1000")));
        bank.tell(new AccountDebit(Float.parseFloat("1000")));
        bank.tell(new AccountDebit(Float.parseFloat("3500")));
        bank.tell(new AccountCredit(Float.parseFloat("2500")));
        bank.tell(new AccountDebit(Float.parseFloat("3500")));

        // sleeping to allow some time for all messages to be processed
        Thread.sleep(4000);
View Full Code Here

    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);

    System.out.println(mysqlSetting.DB_NAME);
View Full Code Here

        bank.tell(new AccountCredit(Float.parseFloat("1000")));
        bank.tell(new AccountDebit(Float.parseFloat("1000")));
        bank.tell(new AccountDebit(Float.parseFloat("1000")));
        bank.tell(new AccountDebit(Float.parseFloat("3500")));
        bank.tell(new AccountCredit(Float.parseFloat("2500")));
        bank.tell(new AccountDebit(Float.parseFloat("3500")));

        // sleeping to allow some time for all messages to be processed
        Thread.sleep(4000);

        AccountBalance balance = (AccountBalance) Await.result(
View Full Code Here

    ActorRef actor = _system.actorOf(new Props(MsgEchoActor.class)
        .withDispatcher("CallingThreadDispatcher").withRouter(
            new RoundRobinRouter(2)));

    for (int i = 0; i < 5; i++) {
      actor.tell(i);
    }

    _system.shutdown();

  }
View Full Code Here

    ActorRef actor = _system.actorOf(new Props(MsgEchoActor.class)
        .withDispatcher("pinnedDispatcher").withRouter(
            new RoundRobinRouter(5)));

    for (int i = 0; i < 25; i++) {
      actor.tell(i);
    }

    _system.shutdown();

  }
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.