public class LightweightBrowserCache extends Object implements BrowserCache
With high concurrent access, because this is not a sophisticated cache, sometimes a cache entry may be lost. It is consistent though.
BrowserCache.Entry, BrowserCache.Header
Modifier and Type | Field and Description |
---|---|
protected AtomicLong |
bytes |
protected BrowserCache |
internalCache |
protected long |
maxBytes |
Constructor and Description |
---|
LightweightBrowserCache() |
LightweightBrowserCache(BrowserCache cache) |
Modifier and Type | Method and Description |
---|---|
void |
clear() |
BrowserCache.Entry |
get(String key,
javax.ws.rs.core.MediaType accept) |
BrowserCache.Entry |
getAny(String key) |
long |
getByteCount() |
BrowserCache |
getInternalCache() |
long |
getMaxBytes() |
BrowserCache.Entry |
put(String key,
javax.ws.rs.core.MediaType mediaType,
javax.ws.rs.core.MultivaluedMap<String,String> headers,
byte[] cached,
int expires,
String etag,
String lastModified) |
BrowserCache.Entry |
remove(String key,
javax.ws.rs.core.MediaType type) |
void |
setInternalCache(BrowserCache internalCache) |
void |
setMaxBytes(long maxBytes) |
protected long maxBytes
protected BrowserCache internalCache
protected AtomicLong bytes
public LightweightBrowserCache()
public LightweightBrowserCache(BrowserCache cache)
public BrowserCache getInternalCache()
public void setInternalCache(BrowserCache internalCache)
public long getMaxBytes()
public void setMaxBytes(long maxBytes)
public BrowserCache.Entry getAny(String key)
getAny
in interface BrowserCache
public BrowserCache.Entry remove(String key, javax.ws.rs.core.MediaType type)
remove
in interface BrowserCache
public long getByteCount()
public BrowserCache.Entry get(String key, javax.ws.rs.core.MediaType accept)
get
in interface BrowserCache
public BrowserCache.Entry put(String key, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<String,String> headers, byte[] cached, int expires, String etag, String lastModified)
put
in interface BrowserCache
public void clear()
clear
in interface BrowserCache
Copyright © 2020 JBoss by Red Hat. All rights reserved.