org.atmosphere.cpr
Interface BroadcasterCache<V,W>

Type Parameters:
V -
W -
All Known Implementing Classes:
BroadcasterCacheBase, BroadcasterConfig.DefaultBroadcasterCache, HeaderBroadcasterCache, SessionBroadcasterCache

public interface BroadcasterCache<V,W>

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.

A BroadcasterCache can be configured by invoking BroadcasterConfig.setBroadcasterCache(BroadcasterCache)


Nested Class Summary
static class BroadcasterCache.STRATEGY
           
 
Field Summary
static String BROADCASTER_CACHE_TRACKER
           
 
Method Summary
 void addToCache(AtmosphereResource<V,W> r, Object e)
          Start tracking messages associated with AtmosphereResource from the cache
 List<Object> retrieveFromCache(AtmosphereResource<V,W> r)
          Retrieve messages associated with AtmosphereResource
 void start()
          Start
 void stop()
          Stop
 

Field Detail

BROADCASTER_CACHE_TRACKER

static final String BROADCASTER_CACHE_TRACKER
Method Detail

start

void start()
Start


stop

void stop()
Stop


addToCache

void addToCache(AtmosphereResource<V,W> r,
                Object e)
Start tracking messages associated with AtmosphereResource from the cache

Parameters:
r - AtmosphereResource
e - a broadcasted message.

retrieveFromCache

List<Object> retrieveFromCache(AtmosphereResource<V,W> r)
Retrieve messages associated with AtmosphereResource

Parameters:
r - AtmosphereResource
Returns:
a List of messages (String).


Copyright © 2011. All Rights Reserved.