org.atmosphere.util
Class SimpleBroadcaster
java.lang.Object
org.atmosphere.cpr.DefaultBroadcaster
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
| 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 |
SimpleBroadcaster
public SimpleBroadcaster()
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.