Package org.atmosphere.util
Class AbstractBroadcasterProxy
java.lang.Object
org.atmosphere.cpr.DefaultBroadcaster
org.atmosphere.util.AbstractBroadcasterProxy
- All Implemented Interfaces:
Broadcaster
Abstract
Broadcaster that delegates the internal processing to a proxy.- Author:
- Jeanfrancois Arcand
-
Nested Class Summary
Nested classes/interfaces inherited from class org.atmosphere.cpr.DefaultBroadcaster
DefaultBroadcaster.AsyncWriteToken, DefaultBroadcaster.WriteQueueNested classes/interfaces inherited from interface org.atmosphere.cpr.Broadcaster
Broadcaster.POLICY, Broadcaster.SCOPE -
Field Summary
Fields inherited from class org.atmosphere.cpr.DefaultBroadcaster
asyncWriteFuture, 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, writeTimeoutInSecondFields inherited from interface org.atmosphere.cpr.Broadcaster
ROOT_MASTER -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionBroadcast theObjectto all suspended responses, eg.broadcast(Object msg, Set<AtmosphereResource> subset) Broadcast theObjectto all suspended response, eg.broadcast(Object msg, AtmosphereResource r) Broadcast theObjectto all suspended responses, eg.protected voidbroadcastReceivedMessage(Object message) protected Runnableabstract voidImplement this method to broadcast message received from an external source like JGroups, Redis, etc.initialize(String id, URI uri, AtmosphereConfig config) Configure a Broadcaster.protected voidabstract voidoutgoingBroadcast(Object message) Implement this method to broadcast message to external source like JGroups, Redis, etc.protected voidMethods inherited from class org.atmosphere.cpr.DefaultBroadcaster
addAtmosphereResource, addBroadcasterLifeCyclePolicyListener, addBroadcasterListener, awaitAndBroadcast, broadcasterListeners, broadcastOnResume, broadcastOnResume, cacheAndSuspend, cacheLostMessage, cacheLostMessage, cacheLostMessage, cacheMessageOnIOException, checkCachedAndPush, createBroadcasterConfig, currentLifecycleTask, currentLifecycleTask, delayBroadcast, delayBroadcast, deliverPush, destroy, dispatchMessages, endBroadcast, entryDone, executeAsyncWrite, executeBlockingWrite, filter, futureDone, getAsyncWriteHandler, getAtmosphereResources, getBroadcasterConfig, getBroadcasterLifeCyclePolicy, getID, getScope, initialize, isDestroyed, killReactiveThreads, lifecycleHandler, lifecycleHandler, lifeCycleListeners, lifeCyclePolicy, messages, notifyAndAdd, notifyBroadcastListener, notifyOnAddAtmosphereResourceListener, notifyOnMessage, notifyOnRemoveAtmosphereResourceListener, onException, onException, outOfOrderBroadcastSupported, perRequestFilter, policy, prepareInvokeOnStateChange, push, queueWriteIO, reactiveThreadsCount, recentActivity, releaseExternalResources, removeAtmosphereResource, removeAtmosphereResource, removeBroadcasterLifeCyclePolicyListener, removeBroadcasterListener, rename, resumeAll, retrieveTrackedBroadcast, scheduleFixedBroadcast, scheduleFixedBroadcast, setBroadcasterConfig, setBroadcasterLifeCyclePolicy, setID, setScope, setSuspendPolicy, spawnReactor, start, toString, writeQueues
-
Constructor Details
-
AbstractBroadcasterProxy
public AbstractBroadcasterProxy()
-
-
Method Details
-
initialize
Description copied from interface:BroadcasterConfigure a Broadcaster.- Specified by:
initializein interfaceBroadcaster- Overrides:
initializein classDefaultBroadcaster- Parameters:
id-uri-config- anAtmosphereConfig- Returns:
- a usable Broadcaster.
-
incomingBroadcast
public abstract void incomingBroadcast()Implement this method to broadcast message received from an external source like JGroups, Redis, etc. -
outgoingBroadcast
Implement this method to broadcast message to external source like JGroups, Redis, etc.- Parameters:
message- outgoing message
-
getBroadcastHandler
- Overrides:
getBroadcastHandlerin classDefaultBroadcaster
-
reconfigure
protected void reconfigure() -
invokeOnStateChange
- Overrides:
invokeOnStateChangein classDefaultBroadcaster
-
broadcastReceivedMessage
-
broadcast
Description copied from interface:BroadcasterBroadcast theObjectto all suspended responses, eg. invokeAtmosphereHandler.onStateChange(org.atmosphere.cpr.AtmosphereResourceEvent).- Specified by:
broadcastin interfaceBroadcaster- Overrides:
broadcastin classDefaultBroadcaster- Parameters:
msg- theObjectto be broadcasted- Returns:
- a
Futurethat can be used to synchronize using theFuture.get()
-
b
-
broadcast
Description copied from interface:BroadcasterBroadcast theObjectto all suspended responses, eg. invokeAtmosphereHandler.onStateChange(org.atmosphere.cpr.AtmosphereResourceEvent)with an instance ofAtmosphereResource, representing a single suspended response.- Specified by:
broadcastin interfaceBroadcaster- Overrides:
broadcastin classDefaultBroadcaster- Parameters:
msg- theObjectto be broadcastedr- anAtmosphereResource- Returns:
- a
Futurethat can be used to synchronize using theFuture.get()
-
broadcast
Description copied from interface:BroadcasterBroadcast theObjectto all suspended response, eg. invokeAtmosphereHandler.onStateChange(org.atmosphere.cpr.AtmosphereResourceEvent)with aSetofAtmosphereResource, representing a set ofAtmosphereHandler.- Specified by:
broadcastin interfaceBroadcaster- Overrides:
broadcastin classDefaultBroadcaster- Parameters:
msg- theObjectto be broadcastedsubset- a Set ofAtmosphereResource- Returns:
- a
Futurethat can be used to synchronize using theFuture.get()
-