public class SimpleBroadcaster extends DefaultBroadcaster
Broadcaster implementation that use the calling thread when broadcasting events.DefaultBroadcaster.AsyncWriteToken, DefaultBroadcaster.WriteQueueBroadcaster.POLICY, Broadcaster.SCOPEasyncWriteFuture, bc, broadcasterListeners, broadcastOnResume, CACHED, candidateForPoolable, config, delayedBroadcast, destroyed, dispatchThread, initialized, lifeCycleListeners, messages, name, notifierFuture, POLLING_DEFAULT, resources, scope, sharedListeners, started, uniqueWriteQueue, uri, usingTokenIdForAttribute, waitTime, writeQueues, writeTimeoutInSecondROOT_MASTER| Constructor and Description |
|---|
SimpleBroadcaster() |
| Modifier and Type | Method and Description |
|---|---|
Future<Object> |
broadcast(Object msg)
Broadcast the
Object to all suspended responses, eg. |
Future<Object> |
broadcast(Object msg,
AtmosphereResource r)
Broadcast the
Object to all suspended responses, eg. |
Future<Object> |
broadcast(Object msg,
Set<AtmosphereResource> subset)
Broadcast the
Object to all suspended response, eg. |
protected BroadcasterConfig |
createBroadcasterConfig(AtmosphereConfig config)
Create
BroadcasterConfig. |
Broadcaster |
initialize(String id,
AtmosphereConfig config) |
protected void |
prepareInvokeOnStateChange(AtmosphereResource r,
AtmosphereResourceEvent e) |
protected void |
queueWriteIO(AtmosphereResource r,
Deliver deliver,
AtomicInteger count) |
void |
setBroadcasterConfig(BroadcasterConfig bc)
Set the
BroadcasterConfig instance. |
protected void |
start() |
addAtmosphereResource, addBroadcasterLifeCyclePolicyListener, addBroadcasterListener, awaitAndBroadcast, broadcasterListeners, broadcastOnResume, broadcastOnResume, cacheAndSuspend, cacheLostMessage, cacheLostMessage, cacheLostMessage, cacheMessageOnIOException, checkCachedAndPush, currentLifecycleTask, currentLifecycleTask, delayBroadcast, delayBroadcast, deliverPush, destroy, dispatchMessages, endBroadcast, entryDone, executeAsyncWrite, executeBlockingWrite, filter, futureDone, getAsyncWriteHandler, getAtmosphereResources, getBroadcasterConfig, getBroadcasterLifeCyclePolicy, getBroadcastHandler, getID, getScope, initialize, invokeOnStateChange, isDestroyed, killReactiveThreads, lifecycleHandler, lifecycleHandler, lifeCycleListeners, lifeCyclePolicy, messages, notifyAndAdd, notifyBroadcastListener, notifyOnAddAtmosphereResourceListener, notifyOnMessage, notifyOnRemoveAtmosphereResourceListener, onException, onException, outOfOrderBroadcastSupported, perRequestFilter, policy, push, reactiveThreadsCount, recentActivity, releaseExternalResources, removeAtmosphereResource, removeAtmosphereResource, removeBroadcasterLifeCyclePolicyListener, removeBroadcasterListener, rename, resumeAll, retrieveTrackedBroadcast, scheduleFixedBroadcast, scheduleFixedBroadcast, setBroadcasterLifeCyclePolicy, setID, setScope, setSuspendPolicy, spawnReactor, toString, writeQueuespublic Broadcaster initialize(String id, AtmosphereConfig config)
initialize in class DefaultBroadcasterprotected BroadcasterConfig createBroadcasterConfig(AtmosphereConfig config)
DefaultBroadcasterBroadcasterConfig.createBroadcasterConfig in class DefaultBroadcasterconfig - the AtmosphereConfigBroadcasterConfigprotected void start()
start in class DefaultBroadcasterpublic void setBroadcasterConfig(BroadcasterConfig bc)
BroadcasterBroadcasterConfig instance.setBroadcasterConfig in interface BroadcastersetBroadcasterConfig in class DefaultBroadcasterbc - Configuration to be set.public Future<Object> broadcast(Object msg)
BroadcasterObject to all suspended responses, eg. invoke AtmosphereHandler.onStateChange(org.atmosphere.cpr.AtmosphereResourceEvent).broadcast in interface Broadcasterbroadcast in class DefaultBroadcastermsg - the Object to be broadcastedFuture that can be used to synchronize using the Future.get()public Future<Object> broadcast(Object msg, AtmosphereResource r)
BroadcasterObject to all suspended responses, eg. invoke
AtmosphereHandler.onStateChange(org.atmosphere.cpr.AtmosphereResourceEvent) with an instance of AtmosphereResource, representing
a single suspended response.broadcast in interface Broadcasterbroadcast in class DefaultBroadcastermsg - the Object to be broadcastedr - an AtmosphereResourceFuture that can be used to synchronize using the Future.get()public Future<Object> broadcast(Object msg, Set<AtmosphereResource> subset)
BroadcasterObject to all suspended response, eg. invoke
AtmosphereHandler.onStateChange(org.atmosphere.cpr.AtmosphereResourceEvent) with a Set of AtmosphereResource,
representing a set of AtmosphereHandler.broadcast in interface Broadcasterbroadcast in class DefaultBroadcastermsg - the Object to be broadcastedsubset - 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, Deliver deliver, AtomicInteger count) throws InterruptedException
queueWriteIO in class DefaultBroadcasterInterruptedExceptionCopyright © 2016. All rights reserved.