Class JettyResourceFactory

java.lang.Object
org.springframework.http.client.reactive.JettyResourceFactory
All Implemented Interfaces:
org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean

public class JettyResourceFactory extends Object implements org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.DisposableBean
Factory to manage Jetty resources, i.e. Executor, ByteBufferPool and Scheduler, within the lifecycle of a Spring ApplicationContext.

This factory implements InitializingBean and DisposableBean and is expected typically to be declared as a Spring-managed bean.

Since:
5.1
Author:
Sebastien Deleuze
  • Constructor Details

    • JettyResourceFactory

      public JettyResourceFactory()
  • Method Details

    • setExecutor

      public void setExecutor(@Nullable Executor executor)
      Configure the Executor to use.

      By default, initialized with a QueuedThreadPool.

      Parameters:
      executor - the executor to use
    • setByteBufferPool

      public void setByteBufferPool(@Nullable org.eclipse.jetty.io.ByteBufferPool byteBufferPool)
      Configure the ByteBufferPool to use.

      By default, initialized with a MappedByteBufferPool.

      Parameters:
      byteBufferPool - the ByteBuffer pool to use
    • setScheduler

      public void setScheduler(@Nullable org.eclipse.jetty.util.thread.Scheduler scheduler)
      Configure the Scheduler to use.

      By default, initialized with a ScheduledExecutorScheduler.

      Parameters:
      scheduler - the Scheduler to use
    • setThreadPrefix

      public void setThreadPrefix(String threadPrefix)
      Configure the thread prefix to initialize QueuedThreadPool executor with. This is used only when a Executor instance isn't provided.

      By default set to "jetty-http".

      Parameters:
      threadPrefix - the thread prefix to use
    • getExecutor

      @Nullable public Executor getExecutor()
      Return the configured Executor.
    • getByteBufferPool

      @Nullable public org.eclipse.jetty.io.ByteBufferPool getByteBufferPool()
      Return the configured ByteBufferPool.
    • getScheduler

      @Nullable public org.eclipse.jetty.util.thread.Scheduler getScheduler()
      Return the configured Scheduler.
    • afterPropertiesSet

      public void afterPropertiesSet() throws Exception
      Specified by:
      afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
      Throws:
      Exception
    • destroy

      public void destroy() throws Exception
      Specified by:
      destroy in interface org.springframework.beans.factory.DisposableBean
      Throws:
      Exception