Package akka.actor

Examples of akka.actor.Props


   */
  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


                Float.parseFloat("0"));
    }

    @Test
    public void failureTest() throws Exception {
        TestActorRef<BankActor> bank = TestActorRef.apply(new Props(
                BankActor.class), _system);

        bank.tell(new TransferMsg(Float.valueOf("1500")));

        AccountBalance balance = (AccountBalance) Await.result(
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

    Address[] workerAddress = workerAddressMap.values().toArray(
        addressNodes);

    // update the workerRouter actor with the information on all workers
    workerRouterActor = getContext().system().actorOf(
        new Props(WorkerActor.class).withRouter(new RemoteRouterConfig(
            new RoundRobinRouter(workerAddress.length),
            workerAddress)));

  }
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

      Address[] workerAddress = workerAddressMap.values().toArray(
          addressNodes);

      workerRouterActor = getContext().system().actorOf(
          new Props(WorkerActor.class)
              .withRouter(new RemoteRouterConfig(
                  new RoundRobinRouter(workerAddress.length),
                  workerAddress)));
    } else
      workerRouterActor = null;
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

public class SupervisorActor extends UntypedActor {

  public ActorRef childActor;

  public SupervisorActor() {
    childActor = getContext().actorOf(new Props(WorkerActor.class),
        "workerActor");
  }
View Full Code Here

   */
  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
      randomRouter.tell(i);
View Full Code Here

TOP

Related Classes of akka.actor.Props

Copyright © 2018 www.massapicom. 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.