Class FileMappingHttpContentFactory

java.lang.Object
org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.ContainerLifeCycle
org.eclipse.jetty.http.content.FileMappingHttpContentFactory
All Implemented Interfaces:
HttpContent.Factory, org.eclipse.jetty.util.component.Container, org.eclipse.jetty.util.component.Destroyable, org.eclipse.jetty.util.component.Dumpable, org.eclipse.jetty.util.component.Dumpable.DumpableContainer, org.eclipse.jetty.util.component.LifeCycle

@ManagedObject public class FileMappingHttpContentFactory extends org.eclipse.jetty.util.component.ContainerLifeCycle implements HttpContent.Factory
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

    org.eclipse.jetty.util.component.AbstractLifeCycle.AbstractLifeCycleListener, org.eclipse.jetty.util.component.AbstractLifeCycle.StopException

    Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Container

    org.eclipse.jetty.util.component.Container.InheritedListener, org.eclipse.jetty.util.component.Container.Listener

    Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable

    org.eclipse.jetty.util.component.Dumpable.DumpableContainer, org.eclipse.jetty.util.component.Dumpable.DumpAppendable

    Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle

    org.eclipse.jetty.util.component.LifeCycle.Listener
  • Field Summary

    Fields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

    FAILED, STARTED, STARTING, STOPPED, STOPPING

    Fields inherited from interface org.eclipse.jetty.util.component.Dumpable

    LEGEND
  • Constructor Summary

    Constructors
    Constructor
    Description
    Construct a FileMappingHttpContentFactory which can use file mapped buffers.
    FileMappingHttpContentFactory(HttpContent.Factory factory, int minFileSize, int maxBufferSize)
    Construct a FileMappingHttpContentFactory which can use file mapped buffers.
  • Method Summary

    Modifier and Type
    Method
    Description
    Get the HttpContent instance of a path.
    int
     
    int
     

    Methods inherited from class org.eclipse.jetty.util.component.ContainerLifeCycle

    addBean, addBean, addEventListener, addManaged, addManaged, contains, destroy, doStart, doStop, dump, dump, dump, dumpObjects, dumpStdErr, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, installBean, installBean, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, start, stop, unmanage, updateBean, updateBean, updateBeans, updateBeans

    Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

    getEventListeners, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, setEventListeners, start, stop, toString

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.eclipse.jetty.util.component.Container

    getCachedBeans, getEventListeners

    Methods inherited from interface org.eclipse.jetty.util.component.Dumpable

    dumpSelf

    Methods inherited from interface org.eclipse.jetty.util.component.Dumpable.DumpableContainer

    isDumpable
  • Constructor Details

    • FileMappingHttpContentFactory

      public FileMappingHttpContentFactory(HttpContent.Factory factory)
      Construct a FileMappingHttpContentFactory which can use file mapped buffers. Uses a default value of 1048576 for the minimum size of an HttpContent before trying to use a file mapped buffer.
      Parameters:
      factory - the wrapped HttpContent.Factory to use.
    • FileMappingHttpContentFactory

      public FileMappingHttpContentFactory(HttpContent.Factory factory, int minFileSize, int maxBufferSize)
      Construct a FileMappingHttpContentFactory which can use file mapped buffers.
      Parameters:
      factory - the wrapped HttpContent.Factory to use.
      minFileSize - the minimum size of an HttpContent before trying to use a file mapped buffer; or -1 for a default.
      maxBufferSize - the maximum size of the memory mapped buffers; or -1 for a default.
  • Method Details

    • getContent

      public HttpContent getContent(String path) throws IOException
      Description copied from interface: HttpContent.Factory
      Get the HttpContent instance of a path.
      Specified by:
      getContent in interface HttpContent.Factory
      Parameters:
      path - The path.
      Returns:
      A HttpContent instance.
      Throws:
      IOException - if unable to get content
    • getMinFileSize

      @ManagedAttribute(value="The minimum size of a file before trying to use memory mapping", readonly=true) public int getMinFileSize()
    • getMaxBufferSize

      @ManagedAttribute(value="The maximum size of the memory mapped buffers", readonly=true) public int getMaxBufferSize()