Examples of Broadcast


Examples of akka.routing.Broadcast

  public void demonstrateBroadcast() {
    new JavaTestKit(system) {{
      ActorRef router = system.actorOf(new RoundRobinPool(5).props(
        Props.create(Echo.class)));
      //#broadcastDavyJonesWarning
      router.tell(new Broadcast("Watch out for Davy Jones' locker"), getTestActor());
      //#broadcastDavyJonesWarning
      assertEquals(5, receiveN(5).length);
    }};
  }
View Full Code Here

Examples of akka.routing.Broadcast

  public void demonstrateBroadcastPoisonPill() {
    new JavaTestKit(system) {{
      ActorRef router = watch(system.actorOf(new RoundRobinPool(5).props(
        Props.create(Echo.class))));
      //#broadcastPoisonPill
      router.tell(new Broadcast(PoisonPill.getInstance()), getTestActor());
      //#broadcastPoisonPill
      expectTerminated(router);
    }};
  }
View Full Code Here

Examples of akka.routing.Broadcast

  public void demonstrateBroadcastKill() {
    new JavaTestKit(system) {{
      ActorRef router = watch(system.actorOf(new RoundRobinPool(5).props(
        Props.create(Echo.class))));
      //#broadcastKill
      router.tell(new Broadcast(Kill.getInstance()), getTestActor());
      //#broadcastKill
      expectTerminated(router);
    }};
  }
View Full Code Here

Examples of org.atmosphere.annotation.Broadcast

             * --- the action invoker will marshall the embedded entity
             */
            return view;
        }
       
        Broadcast broadcastAnnotation = ctx.getActionAnnotation(Broadcast.class);
        if (broadcastAnnotation != null) {
           
            List<ClusterBroadcastFilter> clusterBroadcastFilters =
                    new ArrayList<ClusterBroadcastFilter>();
           
            Cluster clusterAnnotation = ctx.getActionAnnotation(Cluster.class);
            if (clusterAnnotation != null) {
                Class<? extends ClusterBroadcastFilter>[] clusterFilters = clusterAnnotation.value();
                for (Class<? extends ClusterBroadcastFilter> c : clusterFilters) {
                    try {
                        ClusterBroadcastFilter cbf = c.newInstance();
                        InjectorProvider.getInjector().inject(cbf);
                        cbf.setUri(clusterAnnotation.name());
                        clusterBroadcastFilters.add(cbf);
                    } catch (Throwable t) {
                        logger.warn("Invalid ClusterBroadcastFilter", t);
                    }
                }
            }
           
            view = doBroadcast(entity, req, config, clusterBroadcastFilters,
                    broadcastAnnotation.delay(), 0,
                    broadcastAnnotation.filters(),
                    broadcastAnnotation.writeEntity(), null,
                    broadcastAnnotation.resumeOnBroadcast());
        }
       
        Asynchronous asyncAnnotation = ctx.getActionAnnotation(Asynchronous.class);
        if (asyncAnnotation != null) {
            doAsynchronous();
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.