|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.atmosphere.cache.UUIDBroadcasterCache
public class UUIDBroadcasterCache
An improved BroadcasterCache implementation.
| Nested Class Summary | |
|---|---|
static class |
UUIDBroadcasterCache.ClientQueue
|
| Field Summary | |
|---|---|
protected ConcurrentHashMap<String,List<String>> |
bannedResources
|
protected List<Object> |
emptyList
|
protected List<BroadcasterCacheInspector> |
inspectors
|
protected ScheduledExecutorService |
taskScheduler
|
| Fields inherited from interface org.atmosphere.cpr.BroadcasterCache |
|---|
DEFAULT |
| Constructor Summary | |
|---|---|
UUIDBroadcasterCache()
|
|
| Method Summary | |
|---|---|
Map<String,Long> |
activeClients()
|
CacheMessage |
addToCache(String broadcasterId,
AtmosphereResource r,
BroadcastMessage message)
Start tracking messages associated with AtmosphereResource from the cache |
void |
clearCache(String broadcasterId,
AtmosphereResource r,
CacheMessage message)
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. |
protected boolean |
inspect(BroadcastMessage m)
|
BroadcasterCache |
inspector(BroadcasterCacheInspector b)
Add a BroadcasterCacheInspector that will be invoked before a message gets added to the cache. |
protected void |
invalidateExpiredEntries()
|
Map<String,UUIDBroadcasterCache.ClientQueue> |
messages()
|
List<Object> |
retrieveFromCache(String broadcasterId,
AtmosphereResource r)
Retrieve messages associated with AtmosphereResource |
void |
setClientIdleTime(long clientIdleTime)
|
void |
setInvalidateCacheInterval(long invalidateCacheInterval)
|
void |
start()
Start |
void |
stop()
Stop |
protected String |
uuid(AtmosphereResource r)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final List<BroadcasterCacheInspector> inspectors
protected ScheduledExecutorService taskScheduler
protected final ConcurrentHashMap<String,List<String>> bannedResources
protected final List<Object> emptyList
| Constructor Detail |
|---|
public UUIDBroadcasterCache()
| Method Detail |
|---|
public void configure(AtmosphereConfig config)
configure in interface BroadcasterCachepublic void start()
start in interface BroadcasterCachepublic void stop()
stop in interface BroadcasterCache
public CacheMessage addToCache(String broadcasterId,
AtmosphereResource r,
BroadcastMessage message)
AtmosphereResource from the cache
addToCache in interface BroadcasterCachebroadcasterId - The associated Broadcaster#addAtmosphereResource(AtmosphereResource).getIDr - AtmosphereResourcemessage - BroadcastMessage.
CacheMessage
public List<Object> retrieveFromCache(String broadcasterId,
AtmosphereResource r)
AtmosphereResource
retrieveFromCache in interface BroadcasterCachebroadcasterId - The associated Broadcaster#addAtmosphereResource(AtmosphereResource).getIDr - AtmosphereResource
List of messages (String).
public void clearCache(String broadcasterId,
AtmosphereResource r,
CacheMessage message)
clearCache in interface BroadcasterCachebroadcasterId - The Broadcaster.getID()r - an AtmosphereResourcemessage - the CacheMessagepublic BroadcasterCache inspector(BroadcasterCacheInspector b)
BroadcasterCacheInspector that will be invoked before a message gets added to the cache.
inspector in interface BroadcasterCacheprotected String uuid(AtmosphereResource r)
public Map<String,UUIDBroadcasterCache.ClientQueue> messages()
public Map<String,Long> activeClients()
protected boolean inspect(BroadcastMessage m)
public void setInvalidateCacheInterval(long invalidateCacheInterval)
public void setClientIdleTime(long clientIdleTime)
protected void invalidateExpiredEntries()
public void excludeFromCache(String broadcasterId,
AtmosphereResource r)
BroadcasterCacheAtmosphereResource to received cached message.
excludeFromCache in interface BroadcasterCachebroadcasterId - The Broadcaster.getID()r - an AtmosphereResource
public boolean includeInCache(String broadcasterId,
AtmosphereResource r)
BroadcasterCacheAtmosphereResource to receive cached message.
includeInCache in interface BroadcasterCachebroadcasterId - The Broadcaster.getID()r - an AtmosphereResource
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||