org.eclipse.jetty.http.HttpContent.ContentFactorypublic class CachedContentFactory
extends java.lang.Object
implements org.eclipse.jetty.http.HttpContent.ContentFactory
| Modifier and Type | Class | Description |
|---|---|---|
class |
CachedContentFactory.CachedHttpContent |
MetaData associated with a context Resource.
|
class |
CachedContentFactory.CachedPrecompressedHttpContent |
| Constructor | Description |
|---|---|
CachedContentFactory(CachedContentFactory parent,
org.eclipse.jetty.util.resource.ResourceFactory factory,
org.eclipse.jetty.http.MimeTypes mimeTypes,
boolean useFileMappedBuffer,
boolean etags,
org.eclipse.jetty.http.CompressedContentFormat[] precompressedFormats) |
Constructor.
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
flushCache() |
|
int |
getCachedFiles() |
|
int |
getCachedSize() |
|
org.eclipse.jetty.http.HttpContent |
getContent(java.lang.String pathInContext,
int maxBufferSize) |
Returns an entry from the cache, or creates a new one.
|
protected java.nio.ByteBuffer |
getDirectBuffer(org.eclipse.jetty.util.resource.Resource resource) |
|
protected java.nio.ByteBuffer |
getIndirectBuffer(org.eclipse.jetty.util.resource.Resource resource) |
|
protected java.nio.ByteBuffer |
getMappedBuffer(org.eclipse.jetty.util.resource.Resource resource) |
|
int |
getMaxCachedFiles() |
|
int |
getMaxCachedFileSize() |
|
int |
getMaxCacheSize() |
|
protected boolean |
isCacheable(org.eclipse.jetty.util.resource.Resource resource) |
|
boolean |
isUseFileMappedBuffer() |
|
org.eclipse.jetty.http.HttpContent |
lookup(java.lang.String pathInContext) |
Deprecated.
|
void |
setMaxCachedFiles(int maxCachedFiles) |
|
void |
setMaxCachedFileSize(int maxCachedFileSize) |
|
void |
setMaxCacheSize(int maxCacheSize) |
|
java.lang.String |
toString() |
public CachedContentFactory(CachedContentFactory parent, org.eclipse.jetty.util.resource.ResourceFactory factory, org.eclipse.jetty.http.MimeTypes mimeTypes, boolean useFileMappedBuffer, boolean etags, org.eclipse.jetty.http.CompressedContentFormat[] precompressedFormats)
parent - the parent resource cachefactory - the resource factorymimeTypes - Mimetype to use for meta datauseFileMappedBuffer - true to file memory mapped buffersetags - true to support etagsprecompressedFormats - array of precompression formats to supportpublic int getCachedSize()
public int getCachedFiles()
public int getMaxCachedFileSize()
public void setMaxCachedFileSize(int maxCachedFileSize)
public int getMaxCacheSize()
public void setMaxCacheSize(int maxCacheSize)
public int getMaxCachedFiles()
public void setMaxCachedFiles(int maxCachedFiles)
maxCachedFiles - the max number of cached files.public boolean isUseFileMappedBuffer()
public void flushCache()
@Deprecated
public org.eclipse.jetty.http.HttpContent lookup(java.lang.String pathInContext)
throws java.io.IOException
java.io.IOExceptionpublic org.eclipse.jetty.http.HttpContent getContent(java.lang.String pathInContext,
int maxBufferSize)
throws java.io.IOException
Returns an entry from the cache, or creates a new one.
getContent in interface org.eclipse.jetty.http.HttpContent.ContentFactorypathInContext - The key into the cachemaxBufferSize - The maximum buffer size allocated for this request. For cached content, a larger buffer may have
previously been allocated and returned by the HttpContent.getDirectBuffer() or HttpContent.getIndirectBuffer() calls.pathInContext, or a new entry
if no matching entry was found. If the content exists but is not cacheable,
then a ResourceHttpContent instance is returned. If
the resource does not exist, then null is returned.java.io.IOException - if the resource cannot be retrievedprotected boolean isCacheable(org.eclipse.jetty.util.resource.Resource resource)
resource - the resource to testprotected java.nio.ByteBuffer getIndirectBuffer(org.eclipse.jetty.util.resource.Resource resource)
protected java.nio.ByteBuffer getMappedBuffer(org.eclipse.jetty.util.resource.Resource resource)
protected java.nio.ByteBuffer getDirectBuffer(org.eclipse.jetty.util.resource.Resource resource)
public java.lang.String toString()
toString in class java.lang.ObjectCopyright © 1995–2018 Webtide. All rights reserved.