|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface BroadcasterCache
A BroadcasterCache is used to persist broadcasted Object Broadcaster.broadcast(Object). Disconnected clients
can always retrieve message that were broadcasted during their "downtime". BroadcasterCache are useful when
a the long polling technique is used and prevent application from loosing event between re-connection.
BroadcasterConfig.setBroadcasterCache(BroadcasterCache) by
defining it in your web/application.xml or by using the BroadcasterCacheService
| Field Summary | |
|---|---|
static BroadcasterCache |
DEFAULT
|
| Method Summary | |
|---|---|
CacheMessage |
addToCache(String broadcasterId,
AtmosphereResource r,
BroadcastMessage e)
Start tracking messages associated with AtmosphereResource from the cache |
void |
clearCache(String broadcasterId,
AtmosphereResource r,
CacheMessage cache)
Remove the previously cached message. |
void |
configure(AtmosphereConfig config)
Configure the cache. |
void |
excludeFromCache(String broadcasterId,
AtmosphereResource r)
Allow an application to exclude, or block, an AtmosphereResource to received cached message. |
boolean |
includeInCache(String broadcasterId,
AtmosphereResource r)
Re-allow an AtmosphereResource to receive 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()
Start |
void |
stop()
Stop |
| Field Detail |
|---|
static final BroadcasterCache DEFAULT
| Method Detail |
|---|
void start()
void stop()
void configure(AtmosphereConfig config)
CacheMessage addToCache(String broadcasterId,
AtmosphereResource r,
BroadcastMessage e)
AtmosphereResource from the cache
broadcasterId - The associated Broadcaster#addAtmosphereResource(AtmosphereResource).getIDr - AtmosphereResourcee - BroadcastMessage.
CacheMessage
List<Object> retrieveFromCache(String id,
AtmosphereResource r)
AtmosphereResource
id - The associated Broadcaster#addAtmosphereResource(AtmosphereResource).getIDr - AtmosphereResource
List of messages (String).
void clearCache(String broadcasterId,
AtmosphereResource r,
CacheMessage cache)
broadcasterId - The Broadcaster.getID()r - an AtmosphereResourcecache - the CacheMessage
void excludeFromCache(String broadcasterId,
AtmosphereResource r)
AtmosphereResource to received cached message.
broadcasterId - The Broadcaster.getID()r - an AtmosphereResource
boolean includeInCache(String broadcasterId,
AtmosphereResource r)
AtmosphereResource to receive cached message.
broadcasterId - The Broadcaster.getID()r - an AtmosphereResourceBroadcasterCache inspector(BroadcasterCacheInspector interceptor)
BroadcasterCacheInspector that will be invoked before a message gets added to the cache.
interceptor -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||