Class LightweightBrowserCache
java.lang.Object
org.jboss.resteasy.client.jaxrs.cache.LightweightBrowserCache
- All Implemented Interfaces:
BrowserCache
In-memory BrowserCache. Uses an underlying cache, with ConcurrentMapCache as
the default. You specify maximum bytes you want the cache to have. The
default is 2Megabytes. If the cache exceeds this amount, it is wiped clean.
This rather draconian approach to cache reaping is to avoid synchronization
that you would normally have to do in a sophisticated cache.
With high concurrent access, because this is not a sophisticated cache, sometimes a cache entry may be lost. It is consistent though.
- Version:
- $Revision: 1 $
- Author:
- Bill Burke
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.jboss.resteasy.client.jaxrs.cache.BrowserCache
BrowserCache.Entry, BrowserCache.Header
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
long
long
put
(String key, jakarta.ws.rs.core.MediaType mediaType, jakarta.ws.rs.core.MultivaluedMap<String, String> headers, byte[] cached, int expires, String etag, String lastModified) void
setInternalCache
(BrowserCache internalCache) void
setMaxBytes
(long maxBytes)
-
Field Details
-
maxBytes
protected long maxBytes -
internalCache
-
bytes
-
-
Constructor Details
-
LightweightBrowserCache
public LightweightBrowserCache() -
LightweightBrowserCache
-
-
Method Details
-
getInternalCache
-
setInternalCache
-
getMaxBytes
public long getMaxBytes() -
setMaxBytes
public void setMaxBytes(long maxBytes) -
getAny
- Specified by:
getAny
in interfaceBrowserCache
-
remove
- Specified by:
remove
in interfaceBrowserCache
-
getByteCount
public long getByteCount() -
get
- Specified by:
get
in interfaceBrowserCache
-
put
public BrowserCache.Entry put(String key, jakarta.ws.rs.core.MediaType mediaType, jakarta.ws.rs.core.MultivaluedMap<String, String> headers, byte[] cached, int expires, String etag, String lastModified) - Specified by:
put
in interfaceBrowserCache
-
clear
public void clear()- Specified by:
clear
in interfaceBrowserCache
-