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.
  • Constructor Details

    • RetainedContentLoaderFactory

      public RetainedContentLoaderFactory()
      Creates a RetainedContentLoaderFactory with heuristically determined values for the maximum number bytes to retain and the number of bytes to include in the estimated size per Content.Chunk to 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 a RetainedContentLoaderFactory.
      Parameters:
      maxRetainedBytes - the maximum number bytes to retain whilst eagerly loading, which includes the content bytes and any framingOverhead per 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 per Content.Chunk to 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 - if true, then if maxRetainBytes is exceeded, the request is rejected with a HttpStatus.PAYLOAD_TOO_LARGE_413 response.
  • Method Details