Class EagerContentHandler.RetainedContentLoaderFactory
java.lang.Object
org.eclipse.jetty.server.handler.EagerContentHandler.RetainedContentLoaderFactory
- All Implemented Interfaces:
 EagerContentHandler.ContentLoaderFactory
- Enclosing class:
 EagerContentHandler
public static class EagerContentHandler.RetainedContentLoaderFactory
extends Object
implements EagerContentHandler.ContentLoaderFactory
An 
EagerContentHandler.ContentLoaderFactory for any content, that uses Retainable.retain() to
eagerly load content with zero copies, until all content is read or a maximum size is exceeded.- 
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classDelay dispatch until all content or an effective buffer size is reached - 
Constructor Summary
ConstructorsConstructorDescriptionCreates aRetainedContentLoaderFactorywith heuristically determined values for the maximum number bytes to retain and the number of bytes to include in the estimated size perContent.Chunkto allow for framing overheads in the transport and no rejection of the request when the maximum number bytes to retain is exceeded.RetainedContentLoaderFactory(long maxRetainedBytes, int framingOverhead, boolean reject) Creates aRetainedContentLoaderFactory. - 
Method Summary
 
- 
Constructor Details
- 
RetainedContentLoaderFactory
public RetainedContentLoaderFactory()Creates aRetainedContentLoaderFactorywith heuristically determined values for the maximum number bytes to retain and the number of bytes to include in the estimated size perContent.Chunkto allow for framing overheads in the transport and no rejection of the request when the maximum number bytes to retain is exceeded. - 
RetainedContentLoaderFactory
public RetainedContentLoaderFactory(long maxRetainedBytes, int framingOverhead, boolean reject) Creates aRetainedContentLoaderFactory.- Parameters:
 maxRetainedBytes- the maximum number bytes to retain whilst eagerly loading, which includes the content bytes and anyframingOverheadper chunk; or -1 for a heuristically determined value that will not increase memory commitment.framingOverhead- the number of bytes to include in the estimated size perContent.Chunkto allow for framing overheads in the transport. Since the content is retained rather than copied, any framing data is also retained in the IO buffer; or -1 for a heuristically determined value.reject- iftrue, then ifmaxRetainBytesis exceeded, the request is rejected with aHttpStatus.PAYLOAD_TOO_LARGE_413response.
 
 - 
 - 
Method Details
- 
getApplicableMimeType
- Specified by:
 getApplicableMimeTypein interfaceEagerContentHandler.ContentLoaderFactory- Returns:
 - The mimetype for which this factory is applicable to; or 
nullif applicable to all types. 
 - 
newContentLoader
public EagerContentHandler.ContentLoader newContentLoader(String contentType, String mimeType, Handler handler, Request request, Response response, Callback callback) - Specified by:
 newContentLoaderin interfaceEagerContentHandler.ContentLoaderFactory- Parameters:
 contentType- The content type of the requestmimeType- The mime type extracted from the requesthandler- The next handler to callrequest- The requestresponse- The responsecallback- The callback- Returns:
 - An 
EagerContentHandler.ContentLoaderinstance if the content can be loaded eagerly, elsenull. 
 
 -