类 JettyResourceFactory
- java.lang.Object
- org.springframework.http.client.reactive.JettyResourceFactory
- 所有已实现的接口:
DisposableBean
,InitializingBean
public class JettyResourceFactory extends Object implements InitializingBean, DisposableBean
Factory to manage Jetty resources, i.e.Executor
,ByteBufferPool
andScheduler
, within the lifecycle of a SpringApplicationContext
.This factory implements
InitializingBean
andDisposableBean
and is expected typically to be declared as a Spring-managed bean.- 从以下版本开始:
- 5.1
- 作者:
- Sebastien Deleuze
构造器概要
构造器 构造器 说明 JettyResourceFactory()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 void
afterPropertiesSet()
Invoked by the containingBeanFactory
after it has set all bean properties and satisfiedBeanFactoryAware
,ApplicationContextAware
etc.void
destroy()
Invoked by the containingBeanFactory
on destruction of a bean.org.eclipse.jetty.io.ByteBufferPool
getByteBufferPool()
Return the configuredByteBufferPool
.Executor
getExecutor()
Return the configuredExecutor
.org.eclipse.jetty.util.thread.Scheduler
getScheduler()
Return the configuredScheduler
.void
setByteBufferPool(org.eclipse.jetty.io.ByteBufferPool byteBufferPool)
Configure theByteBufferPool
to use.void
setExecutor(Executor executor)
Configure theExecutor
to use.void
setScheduler(org.eclipse.jetty.util.thread.Scheduler scheduler)
Configure theScheduler
to use.void
setThreadPrefix(String threadPrefix)
Configure the thread prefix to initializeQueuedThreadPool
executor with.
构造器详细资料
JettyResourceFactory
public JettyResourceFactory()
方法详细资料
setExecutor
public void setExecutor(@Nullable Executor executor)
Configure theExecutor
to use.By default, initialized with a
QueuedThreadPool
.- 参数:
executor
- the executor to use
setByteBufferPool
public void setByteBufferPool(@Nullable org.eclipse.jetty.io.ByteBufferPool byteBufferPool)
Configure theByteBufferPool
to use.By default, initialized with a
MappedByteBufferPool
.- 参数:
byteBufferPool
- theByteBuffer
pool to use
setScheduler
public void setScheduler(@Nullable org.eclipse.jetty.util.thread.Scheduler scheduler)
Configure theScheduler
to use.By default, initialized with a
ScheduledExecutorScheduler
.- 参数:
scheduler
- theScheduler
to use
setThreadPrefix
public void setThreadPrefix(String threadPrefix)
Configure the thread prefix to initializeQueuedThreadPool
executor with. This is used only when aExecutor
instance isn'tprovided
.By default set to "jetty-http".
- 参数:
threadPrefix
- the thread prefix to use
getExecutor
@Nullable public Executor 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
public void afterPropertiesSet() throws Exception
从接口复制的说明:InitializingBean
Invoked by the containingBeanFactory
after it has set all bean properties and satisfiedBeanFactoryAware
,ApplicationContextAware
etc.This method allows the bean instance to perform validation of its overall configuration and final initialization when all bean properties have been set.
- 指定者:
afterPropertiesSet
在接口中InitializingBean
- 抛出:
Exception
- in the event of misconfiguration (such as failure to set an essential property) or if initialization fails for any other reason
destroy
public void destroy() throws Exception
从接口复制的说明:DisposableBean
Invoked by the containingBeanFactory
on destruction of a bean.- 指定者:
destroy
在接口中DisposableBean
- 抛出:
Exception
- in case of shutdown errors. Exceptions will get logged but not rethrown to allow other beans to release their resources as well.