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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoiddestroy()org.eclipse.jetty.io.ByteBufferPoolReturn the configuredByteBufferPool.Return the configuredExecutor.org.eclipse.jetty.util.thread.SchedulerReturn the configuredScheduler.voidsetByteBufferPool(org.eclipse.jetty.io.ByteBufferPool byteBufferPool) Configure theByteBufferPoolto use.voidsetExecutor(Executor executor) Configure theExecutorto use.voidsetScheduler(org.eclipse.jetty.util.thread.Scheduler scheduler) Configure theSchedulerto use.voidsetThreadPrefix(String threadPrefix) Configure the thread prefix to initializeQueuedThreadPoolexecutor with.
-
Constructor Details
-
JettyResourceFactory
public JettyResourceFactory()
-
-
Method Details
-
setExecutor
Configure theExecutorto 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 theByteBufferPoolto use.By default, initialized with a
ArrayByteBufferPool.- Parameters:
byteBufferPool- theByteBufferpool to use
-
setScheduler
public void setScheduler(@Nullable org.eclipse.jetty.util.thread.Scheduler scheduler) Configure theSchedulerto use.By default, initialized with a
ScheduledExecutorScheduler.- Parameters:
scheduler- theSchedulerto use
-
setThreadPrefix
Configure the thread prefix to initializeQueuedThreadPoolexecutor with. This is used only when aExecutorinstance isn'tprovided.By default set to "jetty-http".
- Parameters:
threadPrefix- the thread prefix to use
-
getExecutor
Return the configuredExecutor. -
getByteBufferPool
@Nullable public org.eclipse.jetty.io.ByteBufferPool getByteBufferPool()Return the configuredByteBufferPool. -
getScheduler
@Nullable public org.eclipse.jetty.util.thread.Scheduler getScheduler()Return the configuredScheduler. -
afterPropertiesSet
- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
Exception
-
destroy
- Specified by:
destroyin interfaceorg.springframework.beans.factory.DisposableBean- Throws:
Exception
-