Package akka.actor

Examples of akka.actor.UntypedActorFactory


    // create the job controller actor, which manages the routees and sends
    // out
    // work packets to the registered workers
    jobControllerActor = system.actorOf(new Props(
        new UntypedActorFactory() {
          public UntypedActor create() {
            return new JobControllerActor(workSchedulerActor);
          }
        }), "JobControllerActor");
   
    remoteActorListener = system.actorOf(new Props(
        new UntypedActorFactory() {
          public UntypedActor create() {
            return new RemoteClientEventListener(jobControllerActor);
          }
        }), "RemoteClientEventListener");


    // actor that registers and unregisters the workers
    registerRemoteWorkerActor = system.actorOf(new Props(
        new UntypedActorFactory() {
          public UntypedActor create() {
            return new RegisterRemoteWorkerActor(jobControllerActor);
          }
        }), "RegisterRemoteWorkerActor");
View Full Code Here


  }

  @Test
  public void testForwardingActor() {
    ActorRef forwardingActorRef = _system.actorOf(new Props(
        new UntypedActorFactory() {
          public UntypedActor create() {
            return new ForwardingActor(testActor());
          }
        }));
    // pass the reference to implicit sender testActor() otherwise
View Full Code Here

      headList.add(i);
    for (int i = 1; i < randomTail; i++)
      tailList.add(i);

    ActorRef sequencingActorRef = _system.actorOf(new Props(
        new UntypedActorFactory() {
          public UntypedActor create() {
            return new SequencingActor(testActor(), headList,
                tailList);
          }
        }));
View Full Code Here

  }

  @Test
  public void testFilteringActor() {
    ActorRef filteringActorRef = _system.actorOf(new Props(
        new UntypedActorFactory() {
          public UntypedActor create() {
            return new FilteringActor(testActor());
          }
        }));
    // pass the reference to implicit sender testActor() otherwise
View Full Code Here

import akka.actor.UntypedActor;
import akka.actor.UntypedActorFactory;

public class PublisherMain {
  public static void main(String[] args) {
    ActorRef publisher = actorOf(new UntypedActorFactory() {
      public UntypedActor create() {
        return new Publisher("tcp://*:5555", new StringFormat());
      }
    }).start();

View Full Code Here

import akka.actor.UntypedActorFactory;

public class SubscriberMain {
  public static void main(String[] args) {
    final ActorRef logger = actorOf(Logger.class).start();
    ActorRef subscriber = actorOf(new UntypedActorFactory() {
      public UntypedActor create() {
        return new Subscriber("tcp://localhost:5555", new StringFormat(), logger);
      }
    }).start();
    subscriber.sendOneWay(Receive);
View Full Code Here

  public static void main(String[] args) {
    final int iterations = 10000;
    int length = 100000;
    System.out.println("iterations=" + iterations + ", length=" + length + ", total=" + (iterations * length));

    ActorRef accumulator = actorOf(new UntypedActorFactory() {
      public UntypedActor create() {
        return new Accumulator(iterations);
      }
    }).start();

View Full Code Here

    final JLabel temperature = new JLabel("-");
    final JLabel humidity = new JLabel("-");

    // UntypedActor
    final ActorRef sensor = actorOf(WeatherSensor.class).start();
    final ActorRef ui = actorOf(new UntypedActorFactory() {
      public UntypedActor create() {
        return new WeatherUI(sensor, temperature, humidity);
      }
    }).start();
View Full Code Here

    @Before public void initialise() {
        counters = new ArrayList<ActorRef>();
        for (int i = 1; i <= numCounters; i++) {
            final String name = "counter" + i;
            ActorRef counter = UntypedActor.actorOf(new UntypedActorFactory() {
                public UntypedActor create() {
                    return new UntypedCounter(name);
                }
            });
            counter.start();
View Full Code Here

    @Before public void initialise() {
        counters = new ArrayList<ActorRef>();
        for (int i = 1; i <= numCounters; i++) {
            final String name = "counter" + i;
            ActorRef counter = UntypedActor.actorOf(new UntypedActorFactory() {
                public UntypedActor create() {
                    return new UntypedCoordinatedCounter(name);
                }
            });
            counter.start();
View Full Code Here

TOP

Related Classes of akka.actor.UntypedActorFactory

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.