public class SimpleBroadcaster extends DefaultBroadcaster
Broadcaster implementation that use the calling thread when broadcasting events.DefaultBroadcaster.AsyncWriteToken, DefaultBroadcaster.EntryBroadcaster.POLICY, Broadcaster.SCOPEASYNC_TOKEN, asyncWriteFuture, bc, broadcasterListeners, broadcastOnResume, CACHED, cacheStrategy, config, delayedBroadcast, destroyed, dispatchThread, lifeCycleListeners, messages, name, noOpsResource, notifierFuture, outOfOrderBroadcastSupported, resources, scope, started, uniqueWriteQueue, uri, waitTime, writeQueues, writeTimeoutInSecond| Constructor and Description |
|---|
SimpleBroadcaster(java.lang.String id,
AtmosphereConfig config) |
| Modifier and Type | Method and Description |
|---|---|
<T> java.util.concurrent.Future<T> |
broadcast(T msg)
Broadcast the
Object to all suspended response, e.g. |
<T> java.util.concurrent.Future<T> |
broadcast(T msg,
AtmosphereResource r)
Broadcast the
Object to all suspended response, e.g. |
<T> java.util.concurrent.Future<T> |
broadcast(T msg,
java.util.Set<AtmosphereResource> subset)
Broadcast the
Object to all suspended response, e.g. |
protected BroadcasterConfig |
createBroadcasterConfig(AtmosphereConfig config)
Create
BroadcasterConfig |
protected void |
prepareInvokeOnStateChange(AtmosphereResource r,
AtmosphereResourceEvent e) |
protected void |
queueWriteIO(AtmosphereResource r,
java.lang.Object finalMsg,
DefaultBroadcaster.Entry entry) |
void |
setBroadcasterConfig(BroadcasterConfig bc)
Set the
BroadcasterConfig instance. |
protected void |
start() |
addAtmosphereResource, addBroadcasterLifeCyclePolicyListener, addBroadcasterListener, afterFilterCacheEntry, awaitAndBroadcast, broadcastOnResume, broadcastOnResume, cacheAndSuspend, cacheLostMessage, cacheLostMessage, cacheLostMessage, cacheLostMessage, checkCachedAndPush, delayBroadcast, delayBroadcast, deliverPush, destroy, dispatchMessages, entryDone, executeAsyncWrite, filter, finalize, futureDone, getAsyncWriteHandler, getAtmosphereResources, getBroadcasterConfig, getBroadcastHandler, getID, getScope, invokeFiltersAndCache, invokeOnStateChange, isDestroyed, killReactiveThreads, onException, onException, perRequestFilter, push, reactiveThreadsCount, releaseExternalResources, removeAtmosphereResource, removeAtmosphereResource, removeBroadcasterLifeCyclePolicyListener, removeBroadcasterListener, resumeAll, retrieveTrackedBroadcast, scheduleFixedBroadcast, scheduleFixedBroadcast, setBroadcasterCacheStrategy, setBroadcasterLifeCyclePolicy, setID, setScope, setSuspendPolicy, spawnReactor, toString, trackBroadcastMessagepublic SimpleBroadcaster(java.lang.String id,
AtmosphereConfig config)
protected BroadcasterConfig createBroadcasterConfig(AtmosphereConfig config)
BroadcasterConfigcreateBroadcasterConfig in class DefaultBroadcasterconfig - the AtmosphereConfigBroadcasterConfigprotected void start()
start in class DefaultBroadcasterpublic void setBroadcasterConfig(BroadcasterConfig bc)
BroadcasterConfig instance.setBroadcasterConfig in interface BroadcastersetBroadcasterConfig in class DefaultBroadcasterbc - Configuration to be set.public <T> java.util.concurrent.Future<T> broadcast(T msg)
Object to all suspended response, e.g. invoke
AtmosphereHandler.onStateChange(org.atmosphere.cpr.AtmosphereResourceEvent).broadcast in interface Broadcasterbroadcast in class DefaultBroadcastermsg - and Object to be broadcasted.Future that can be used to synchronize using the Future.get()public <T> java.util.concurrent.Future<T> broadcast(T msg,
AtmosphereResource r)
Object to all suspended response, e.g. invoke
AtmosphereHandler.onStateChange(org.atmosphere.cpr.AtmosphereResourceEvent) with an instance of AtmosphereResource, representing
a single suspended response..broadcast in interface Broadcasterbroadcast in class DefaultBroadcastermsg - and Object to be broadcasted.r - an AtmosphereResourceFuture that can be used to synchronize using the Future.get()public <T> java.util.concurrent.Future<T> broadcast(T msg,
java.util.Set<AtmosphereResource> subset)
Object to all suspended response, e.g. invoke
AtmosphereHandler.onStateChange(org.atmosphere.cpr.AtmosphereResourceEvent) with a Set of AtmosphereResource,
representing a set of AtmosphereHandler.broadcast in interface Broadcasterbroadcast in class DefaultBroadcastermsg - and Object to be broadcasted.subset - a Set of AtmosphereResourceFuture that can be used to synchronize using the Future.get()protected void prepareInvokeOnStateChange(AtmosphereResource r, AtmosphereResourceEvent e)
prepareInvokeOnStateChange in class DefaultBroadcasterprotected void queueWriteIO(AtmosphereResource r, java.lang.Object finalMsg, DefaultBroadcaster.Entry entry) throws java.lang.InterruptedException
queueWriteIO in class DefaultBroadcasterjava.lang.InterruptedExceptionCopyright © 2018. All Rights Reserved.