org.atmosphere.util
Class SimpleBroadcaster

java.lang.Object
  extended by org.atmosphere.cpr.DefaultBroadcaster
      extended by org.atmosphere.util.SimpleBroadcaster
All Implemented Interfaces:
Broadcaster

public class SimpleBroadcaster
extends DefaultBroadcaster

Simple Broadcaster implementation that use the calling thread when broadcasting events.

Author:
Jeanfrancois Arcand

Nested Class Summary
 
Nested classes/interfaces inherited from class org.atmosphere.cpr.DefaultBroadcaster
DefaultBroadcaster.Entry
 
Nested classes/interfaces inherited from interface org.atmosphere.cpr.Broadcaster
Broadcaster.SCOPE
 
Field Summary
 
Fields inherited from class org.atmosphere.cpr.DefaultBroadcaster
bc, delayedBroadcast, events, messages, name, scope, started
 
Constructor Summary
SimpleBroadcaster()
           
 
Method Summary
 BroadcasterFuture<Object> broadcast(Object msg)
          Broadcast the Object to all suspended response, e.g.
 BroadcasterFuture<Object> broadcast(Object msg, AtmosphereResource r)
          Broadcast the Object to all suspended response, e.g.
 BroadcasterFuture<Object> broadcast(Object msg, Set<AtmosphereResource> subset)
          Broadcast the Object to all suspended response, e.g.
 
Methods inherited from class org.atmosphere.cpr.DefaultBroadcaster
addAtmosphereResource, atmosphereResources, broadcast, delayBroadcast, delayBroadcast, destroy, filter, getAtmosphereResources, getBroadcasterConfig, getID, getScope, onException, push, removeAtmosphereResource, resumeAll, scheduleFixedBroadcast, scheduleFixedBroadcast, setBroadcasterConfig, setID, setScope, start
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleBroadcaster

public SimpleBroadcaster()
Method Detail

broadcast

public BroadcasterFuture<Object> broadcast(Object msg)
Broadcast the Object to all suspended response, e.g. invoke AtmosphereHandler.onStateChange(org.atmosphere.cpr.AtmosphereResourceEvent).

Specified by:
broadcast in interface Broadcaster
Overrides:
broadcast in class DefaultBroadcaster
Parameters:
msg - and Object to be broadcasted.
Returns:
a Future that can be used to synchronize using the Future.get()

broadcast

public BroadcasterFuture<Object> broadcast(Object msg,
                                           AtmosphereResource r)
Broadcast the Object to all suspended response, e.g. invoke AtmosphereHandler.onStateChange(org.atmosphere.cpr.AtmosphereResourceEvent) with an instance of AtmosphereResource, representing a single suspended response..

Specified by:
broadcast in interface Broadcaster
Overrides:
broadcast in class DefaultBroadcaster
Parameters:
msg - and Object to be broadcasted.
r - an AtmosphereResource
Returns:
a Future that can be used to synchronize using the Future.get()

broadcast

public BroadcasterFuture<Object> broadcast(Object msg,
                                           Set<AtmosphereResource> subset)
Broadcast the Object to all suspended response, e.g. invoke AtmosphereHandler.onStateChange(org.atmosphere.cpr.AtmosphereResourceEvent) with a Set of AtmosphereResource, representing a set of AtmosphereHandler.

Specified by:
broadcast in interface Broadcaster
Overrides:
broadcast in class DefaultBroadcaster
Parameters:
msg - and Object to be broadcasted.
subset - a Set of AtmosphereResource
Returns:
a Future that can be used to synchronize using the Future.get()


Copyright © 2010 SUN Microsystems. All Rights Reserved.