public class DefaultBroadcasterCache extends Object implements BroadcasterCache
DEFAULT| Constructor and Description |
|---|
DefaultBroadcasterCache() |
| Modifier and Type | Method and Description |
|---|---|
CacheMessage |
addToCache(String broadcasterId,
AtmosphereResource r,
BroadcastMessage e)
Start tracking messages associated with
AtmosphereResource from the cache. |
void |
cleanup()
Clean resources associated with this instance.
|
void |
clearCache(String broadcasterId,
AtmosphereResource r,
CacheMessage cache)
Remove the previously cached message.
|
void |
configure(BroadcasterConfig config)
Configure the cache.
|
void |
excludeFromCache(String broadcasterId,
AtmosphereResource r)
Allow an application to exclude, or block, an
AtmosphereResource to received cached message. |
BroadcasterCache |
inspector(BroadcasterCacheInspector interceptor)
Add a
BroadcasterCacheInspector that will be invoked before a message gets added to the cache. |
List<Object> |
retrieveFromCache(String id,
AtmosphereResource r)
Retrieve messages associated with
AtmosphereResource. |
void |
start()
This method is invoked when the Broadcaster is started.
|
void |
stop()
This method is invoked when the Broadcaster is stopped.
|
public void start()
BroadcasterCachestart in interface BroadcasterCachepublic void stop()
BroadcasterCachestop in interface BroadcasterCachepublic void cleanup()
BroadcasterCacheBroadcaster gets destroyed.cleanup in interface BroadcasterCachepublic void configure(BroadcasterConfig config)
BroadcasterCacheconfigure in interface BroadcasterCacheconfig - a BroadcasterConfigpublic CacheMessage addToCache(String broadcasterId, AtmosphereResource r, BroadcastMessage e)
BroadcasterCacheAtmosphereResource from the cache.addToCache in interface BroadcasterCachebroadcasterId - The associated Broadcaster#addAtmosphereResource(AtmosphereResource).getIDr - AtmosphereResourcee - BroadcastMessage.CacheMessagepublic List<Object> retrieveFromCache(String id, AtmosphereResource r)
BroadcasterCacheAtmosphereResource.retrieveFromCache in interface BroadcasterCacheid - The associated Broadcaster#addAtmosphereResource(AtmosphereResource).getIDr - AtmosphereResourceList of messages (String).public void clearCache(String broadcasterId, AtmosphereResource r, CacheMessage cache)
BroadcasterCacheclearCache in interface BroadcasterCachebroadcasterId - The Broadcaster.getID()r - an AtmosphereResourcecache - the CacheMessagepublic void excludeFromCache(String broadcasterId, AtmosphereResource r)
BroadcasterCacheAtmosphereResource to received cached message.
No new message will get sent to this client except the ones already cached.excludeFromCache in interface BroadcasterCachebroadcasterId - The Broadcaster.getID()r - an AtmosphereResourcepublic BroadcasterCache inspector(BroadcasterCacheInspector interceptor)
BroadcasterCacheBroadcasterCacheInspector that will be invoked before a message gets added to the cache.inspector in interface BroadcasterCacheinterceptor - an instance of BroadcasterCacheInspectorCopyright © 2014. All Rights Reserved.