|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.atmosphere.cache.AbstractBroadcasterCache
public abstract class AbstractBroadcasterCache
Abstract BroadcasterCache which is used to implement headers or query parameters or
session based caching.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.atmosphere.cpr.BroadcasterCache |
|---|
BroadcasterCache.Message, BroadcasterCache.STRATEGY |
| Field Summary | |
|---|---|
protected List<BroadcasterCacheInspector> |
inspectors
|
protected long |
invalidateCacheInterval
|
protected boolean |
isShared
|
protected long |
maxCacheTime
|
protected List<CacheMessage> |
messages
|
protected Set<String> |
messagesIds
|
protected ReadWriteLock |
readWriteLock
|
protected ScheduledExecutorService |
reaper
|
protected ScheduledFuture |
scheduledFuture
|
| Constructor Summary | |
|---|---|
AbstractBroadcasterCache()
|
|
| Method Summary | |
|---|---|
protected List<Object> |
get(long cacheHeaderTime)
|
ScheduledExecutorService |
getReaper()
Return the ScheduledExecutorService |
protected boolean |
inspect(BroadcasterCache.Message m)
|
BroadcasterCache |
inspector(BroadcasterCacheInspector b)
Add a BroadcasterCacheInspector that will be invoked before a message gets added to the cache. |
protected void |
put(BroadcasterCache.Message message,
Long now)
|
AbstractBroadcasterCache |
setInvalidateCacheInterval(long invalidateCacheInterval)
Set the time, in millisecond, the cache will be checked and purged. |
AbstractBroadcasterCache |
setMaxCacheTime(long maxCacheTime)
Set the maxium time, in millisecond, a message stay alive in the cache. |
AbstractBroadcasterCache |
setReaper(ScheduledExecutorService reaper)
Set the ScheduledExecutorService to clear the cached message. |
AbstractBroadcasterCache |
setShared(boolean isShared)
Set to true the associated getReaper() is shared amongs BroadcasterCache |
void |
start()
Start |
void |
stop()
Stop |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.atmosphere.cpr.BroadcasterCache |
|---|
addToCache, retrieveFromCache |
| Field Detail |
|---|
protected final List<CacheMessage> messages
protected final Set<String> messagesIds
protected final ReadWriteLock readWriteLock
protected ScheduledFuture scheduledFuture
protected long maxCacheTime
protected long invalidateCacheInterval
protected ScheduledExecutorService reaper
protected boolean isShared
protected final List<BroadcasterCacheInspector> inspectors
| Constructor Detail |
|---|
public AbstractBroadcasterCache()
| Method Detail |
|---|
public void start()
BroadcasterCache
start in interface BroadcasterCachepublic void stop()
BroadcasterCache
stop in interface BroadcasterCache
protected void put(BroadcasterCache.Message message,
Long now)
protected List<Object> get(long cacheHeaderTime)
public AbstractBroadcasterCache setShared(boolean isShared)
getReaper() is shared amongs BroadcasterCache
isShared - to true if shared. False by default.
public AbstractBroadcasterCache setReaper(ScheduledExecutorService reaper)
ScheduledExecutorService to clear the cached message.
reaper - the ScheduledExecutorService to clear the cached message.
public ScheduledExecutorService getReaper()
ScheduledExecutorService
ScheduledExecutorServicepublic AbstractBroadcasterCache setInvalidateCacheInterval(long invalidateCacheInterval)
invalidateCacheInterval -
public AbstractBroadcasterCache setMaxCacheTime(long maxCacheTime)
maxCacheTime - the maxium time, in millisecond, a message stay alive in the cache.
public BroadcasterCache inspector(BroadcasterCacheInspector b)
BroadcasterCacheBroadcasterCacheInspector that will be invoked before a message gets added to the cache.
inspector in interface BroadcasterCacheprotected boolean inspect(BroadcasterCache.Message m)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||